@import url('https://fonts.cdnfonts.com/css/century-gothic-paneuropean');


:root {
    /* Paleta Principal */
    --color-black:         #000000;
    --color-dark:          #1A1A1A;
    --color-white:         #FFFFFF;

    /* Paleta Secundaria (Cobre/Terracota) */
    --color-cream:         #F0EAE0;
    --color-gray:          #CCCCCC;
    --color-sand:          #EEE2C0;
    --color-camel:         #B38F6B;
    --color-peach:         #E5AC7C;
    --color-copper:        #BF6527;
    --color-brown:         #754D2D;
    --color-copper-dark:   #a4531d;

    /* Semántica Modo Claro */
    --bg-page:             #F8F5F0;
    --bg-card:             #FFFFFF;
    --bg-card-hover:       var(--color-cream);
    --border-subtle:       rgba(117, 77, 45, 0.12);
    --border-hover:        var(--color-copper);

    --text-heading:        var(--color-dark);
    --text-body:           var(--color-brown);
    --text-muted:          #8C7A6B;

    --shadow-card:         0 2px 10px rgba(117, 77, 45, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-hover:        0 10px 28px rgba(191, 101, 39, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
    --shadow-modal:        0 20px 48px rgba(0, 0, 0, 0.18);

    --radius-card:         16px;
    --radius-btn:          10px;
    --radius-icon:         13px;

    --transition:          all 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast:     all 0.15s ease;
}

/* ========================================================================
   RESET & BASE
   ======================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Century Gothic Paneuropean', 'Century Gothic', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-body);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1.5rem 5rem;
    line-height: 1.5;
}

/* ========================================================================
   LAYOUT PRINCIPAL
   ======================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ========================================================================
   BARRA SUPERIOR
   ======================================================================== */
.top-bar {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.admin-access-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--bg-card);
    border: 1px solid rgba(179, 143, 107, 0.3);
    color: var(--text-body);
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    padding: 0.45rem 0.95rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.admin-access-btn:hover {
    border-color: var(--color-copper);
    color: var(--color-copper);
    box-shadow: 0 2px 10px rgba(191, 101, 39, 0.15);
}

.admin-access-btn svg {
    width: 15px;
    height: 15px;
}

/* ========================================================================
   CABECERA
   ======================================================================== */
.header {
    width: 100%;
    max-width: 100%;
    text-align: center;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.brand-logo:hover {
    transform: scale(1.04);
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}



h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-heading);
    margin-bottom: 0.4rem;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========================================================================
   BARRA DE HERRAMIENTAS ADMINISTRADOR
   ======================================================================== */
.admin-toolbar {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid rgba(229, 172, 124, 0.45);
    border-radius: 14px;
    padding: 0.9rem 1.3rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 4px 16px rgba(191, 101, 39, 0.09);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.admin-badge {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-copper);
    letter-spacing: 0.01em;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--color-copper);
    box-shadow: 0 0 0 3px rgba(191, 101, 39, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(191, 101, 39, 0.2); }
    50%       { box-shadow: 0 0 0 6px rgba(191, 101, 39, 0.08); }
}

.admin-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

/* ========================================================================
   BOTONES
   ======================================================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: var(--color-copper);
    color: #FFFFFF;
    border: none;
    padding: 0.58rem 1.15rem;
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    background-color: var(--color-copper-dark);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(191, 101, 39, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: var(--color-cream);
    color: var(--text-body);
    border: 1px solid rgba(179, 143, 107, 0.3);
    padding: 0.58rem 1.1rem;
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: #FFFFFF;
    border-color: var(--color-copper);
    color: var(--color-copper);
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(117, 77, 45, 0.22);
    color: var(--text-muted);
    padding: 0.58rem 0.95rem;
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #fff0eb;
    border-color: #d9534f;
    color: #c9302c;
}

.btn-danger {
    background-color: #e53935;
    color: #FFFFFF;
    border: none;
    padding: 0.58rem 1.1rem;
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background-color: #c62828;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

/* ========================================================================
   ESTADO DE CARGA
   ======================================================================== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3.5rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.loading-logo-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2.5px solid rgba(191, 101, 39, 0.15);
    border-top-color: var(--color-copper);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}



/* ========================================================================
   GRID DE SEDES — 3 COLUMNAS
   ======================================================================== */
.link-list {
    list-style: none;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.35rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.link-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
}

/* ========================================================================
   TARJETA DE SEDE
   ======================================================================== */
.sede-btn {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 115px;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.4rem 1.45rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    text-decoration: none;
    color: var(--text-heading);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    overflow: hidden;
}

/* Línea de acento lateral */
.sede-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-peach), var(--color-copper));
    opacity: 0.8;
    transition: width 0.2s ease, opacity 0.2s ease;
}

.sede-btn:hover {
    transform: translateY(-4px);
    background-color: var(--bg-card-hover);
    border-color: rgba(191, 101, 39, 0.35);
    box-shadow: var(--shadow-hover);
}

.sede-btn:hover::before {
    width: 7px;
    opacity: 1;
}

.sede-btn:active {
    transform: scale(0.988);
}

/* Icono */
.sede-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-icon);
    background: linear-gradient(135deg, var(--color-sand), #f5edd8);
    border: 1px solid rgba(179, 143, 107, 0.22);
    color: var(--color-copper);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.sede-btn:hover .sede-icon {
    background: linear-gradient(135deg, var(--color-copper), var(--color-copper-dark));
    color: #FFFFFF;
    border-color: var(--color-copper);
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(191, 101, 39, 0.3);
}

.sede-icon svg {
    width: 24px;
    height: 24px;
}

/* Información */
.sede-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
    gap: 0.22rem;
}

.sede-nombre {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sede-url {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flecha */
.sede-arrow {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-cream);
    border: 1px solid rgba(179, 143, 107, 0.22);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.sede-arrow svg {
    width: 16px;
    height: 16px;
}

.sede-btn:hover .sede-arrow {
    color: #FFFFFF;
    background: var(--color-copper);
    border-color: var(--color-copper);
    transform: translateX(2px) translateY(-2px);
}

/* Acciones de administrador sobre la tarjeta */
.card-admin-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.btn-card-action {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--color-cream);
    color: var(--text-body);
    transition: var(--transition-fast);
}

.btn-card-action svg {
    width: 15px;
    height: 15px;
}

.btn-card-action.btn-edit:hover {
    background: var(--color-copper);
    color: #FFFFFF;
    border-color: var(--color-copper);
    transform: scale(1.08);
}

.btn-card-action.btn-delete:hover {
    background: #e53935;
    color: #FFFFFF;
    border-color: #e53935;
    transform: scale(1.08);
}

/* ========================================================================
   TOASTS DE NOTIFICACIÓN
   ======================================================================== */
.toast-container {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.8rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-heading);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    animation: toastIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    min-width: 220px;
    max-width: 340px;
}

.toast.toast--success { border-left: 4px solid #4caf50; }
.toast.toast--error   { border-left: 4px solid #e53935; }
.toast.toast--info    { border-left: 4px solid var(--color-copper); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }

.toast-out {
    animation: toastOut 0.2s ease-in forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(24px); }
}

/* ========================================================================
   MODALES
   ======================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(6px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal-box {
    background: #FFFFFF;
    border: 1px solid rgba(117, 77, 45, 0.18);
    border-radius: 20px;
    width: 100%;
    max-width: 470px;
    padding: 2rem;
    box-shadow: var(--shadow-modal);
    animation: modalFadeIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-box--sm {
    max-width: 380px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.4rem;
}

.modal-header h2 {
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--text-heading);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.65rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-fast);
    padding: 0 0.2rem;
}

.modal-close-btn:hover {
    color: var(--color-copper);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
    margin-bottom: 1.15rem;
}

.form-group label {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--text-body);
    letter-spacing: 0.01em;
}

.form-group input {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.78rem 0.95rem;
    border: 1px solid rgba(117, 77, 45, 0.22);
    border-radius: var(--radius-btn);
    background: #FAFAFA;
    color: var(--text-heading);
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    background: #FFFFFF;
    border-color: var(--color-copper);
    box-shadow: 0 0 0 3px rgba(191, 101, 39, 0.13);
}

.form-error {
    background: #fff4f4;
    color: #c0392b;
    border: 1px solid rgba(229, 57, 53, 0.3);
    border-radius: 9px;
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 1.1rem;
}

.confirm-msg {
    font-size: 0.95rem;
    color: var(--text-body);
    margin-bottom: 0.25rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.6rem;
}

@media (max-width: 1024px) {
    .link-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.15rem;
    }
}

@media (max-width: 680px) {
    body {
        padding: 1rem 0.6rem 3.5rem;
        overflow-x: hidden;
    }

    .container {
        width: 100%;
        max-width: 100%;
        align-items: center;
    }

    .top-bar,
    .admin-toolbar,
    .link-list {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .header {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1.5rem;
        align-items: center;
        text-align: center;
    }

    .brand-logo {
        width: 104px;
        height: 104px;
    }

    h1 {
        font-size: 1.55rem;
        word-break: break-word;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .subtitle {
        font-size: 0.88rem;
        text-align: center;
    }

    .link-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.7rem;
        width: 100%;
        max-width: 100%;
    }

    .sede-btn {
        min-height: auto;
        min-width: 0;
        padding: 0.7rem 0.8rem;
        gap: 0.7rem;
    }

    .sede-icon {
        width: 40px;
        height: 40px;
    }

    .sede-icon svg {
        width: 19px;
        height: 19px;
    }

    .sede-info {
        min-width: 0;
        gap: 0;
    }

    .sede-nombre {
        font-size: 0.97rem;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* En celular se oculta la URL para que la tarjeta se ajuste a la pantalla */
    .sede-url {
        display: none;
    }

    .sede-arrow {
        width: 28px;
        height: 28px;
    }

    .btn-card-action {
        width: 30px;
        height: 30px;
    }

    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.85rem 1rem;
    }

    .admin-toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn-primary, .btn-secondary, .btn-logout {
        padding: 0.5rem 0.85rem;
        font-size: 0.8rem;
    }

    .modal-box {
        padding: 1.35rem 1.15rem;
        margin: 0 0.5rem;
    }

    .toast-container {
        bottom: 0.85rem;
        right: 0.85rem;
        left: 0.85rem;
    }

    .toast {
        max-width: 100%;
    }
}

/* Dispositivos muy pequeños (móviles compactos) */
@media (max-width: 400px) {
    body {
        padding: 0.75rem 0.45rem 3rem;
    }

    .brand-logo {
        width: 84px;
        height: 84px;
    }

    h1 {
        font-size: 1.32rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .sede-btn {
        padding: 0.6rem 0.65rem;
        gap: 0.55rem;
    }

    .sede-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .sede-icon svg {
        width: 17px;
        height: 17px;
    }

    .sede-nombre {
        font-size: 0.88rem;
    }

    .sede-arrow {
        width: 24px;
        height: 24px;
    }

    .sede-arrow svg {
        width: 13px;
        height: 13px;
    }

    .btn-card-action {
        width: 27px;
        height: 27px;
    }
}
