/*
 * FORO DE FILOSOFÍA Y LENGUAJE
 * Tema Global — Azul Naval & Dorado Académico
 * Inspirado en el logo y mascota institucional
 */

:root {
    --navy:    #0d1b35;
    --navy-2:  #152444;
    --navy-3:  #1e3260;
    --gold:    #C9A84C;
    --gold-l:  #e8c96a;
    --cream:   #F5EDD8;
    --cream-2: #EAE0C8;
    --white:   #ffffff;
    --success: #34d399;
    --warning: #fbbf24;
    --error:   #f87171;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--navy);
    color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse 80% 60% at 5% 0%, rgba(201,168,76,0.06) 0%, transparent 50%),
        radial-gradient(ellipse 70% 80% at 95% 100%, rgba(30,50,96,0.7) 0%, transparent 60%);
    background-attachment: fixed;
}

/* ─── Glass ─── */
.glass {
    background: rgba(21, 36, 68, 0.60);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(201, 168, 76, 0.12);
}

.glass-light {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.07);
}

/* ─── Navigation ─── */
.ffl-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: rgba(13, 27, 53, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    gap: 1rem;
}

.ffl-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.ffl-nav-brand img {
    height: 36px;
    width: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(201,168,76,0.4);
}

.ffl-nav-brand-text {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--cream);
    letter-spacing: 0.04em;
}

.ffl-nav-brand-text span { color: var(--gold); }

.ffl-nav-role {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.25);
    padding: 0.25rem 0.8rem;
    border-radius: 50px;
    flex-shrink: 0;
}

.ffl-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.ffl-nav-user {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cream);
    padding-right: 0.6rem;
    border-right: 1px solid rgba(201,168,76,0.2);
    white-space: nowrap;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, #a07c30 100%);
    color: var(--navy);
    border-color: transparent;
    box-shadow: 0 3px 14px rgba(201,168,76,0.25);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201,168,76,0.4);
}

.btn-ghost {
    background: rgba(255,255,255,0.06);
    color: var(--cream);
    border-color: rgba(255,255,255,0.1);
}

.btn-ghost:hover {
    background: rgba(201,168,76,0.1);
    border-color: rgba(201,168,76,0.3);
    color: var(--gold);
}

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: #f87171;
    border-color: rgba(239,68,68,0.25);
}

.btn-danger:hover {
    background: rgba(239,68,68,0.25);
}

.btn-logout {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(245,237,216,0.5);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

.btn-logout:hover { color: var(--gold); }

/* ─── Inputs ─── */
.input-ffl {
    background: rgba(21, 36, 68, 0.5);
    border: 1px solid rgba(201,168,76,0.2);
    color: var(--cream);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    width: 100%;
    transition: border-color 0.25s;
    font-family: 'Inter', sans-serif;
}

.input-ffl::placeholder { color: rgba(245,237,216,0.3); }

.input-ffl:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(21, 36, 68, 0.7);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

.input-ffl option { background: var(--navy-2); color: var(--cream); }

/* ─── Cards ─── */
.card {
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover { transform: translateY(-3px); }

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
}

.badge-gold {
    background: rgba(201,168,76,0.15);
    color: var(--gold);
    border: 1px solid rgba(201,168,76,0.3);
}

.badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
    border: 1px solid rgba(52,211,153,0.3);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
    border: 1px solid rgba(251,191,36,0.3);
}

.badge-error {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
    border: 1px solid rgba(248,113,113,0.3);
}

/* ─── Alerts ─── */
.alert {
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.alert-success {
    background: rgba(52,211,153,0.08);
    border: 1px solid rgba(52,211,153,0.25);
    color: var(--success);
}

.alert-error {
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.25);
    color: var(--error);
}

.alert-warning {
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.25);
    color: var(--warning);
}

/* ─── Tables ─── */
.table-ffl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table-ffl thead tr {
    border-bottom: 1px solid rgba(201,168,76,0.15);
}

.table-ffl thead th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(201,168,76,0.7);
}

.table-ffl tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.2s;
}

.table-ffl tbody tr:hover {
    background: rgba(201,168,76,0.04);
}

.table-ffl tbody td {
    padding: 0.9rem 1rem;
    color: var(--cream);
}

/* ─── Gradients & Decorative ─── */
.gold-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.3), transparent);
    margin: 1.5rem 0;
}

.text-gold { color: var(--gold); }
.text-cream { color: var(--cream); }
.text-muted { color: rgba(245,237,216,0.45); }

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .ffl-nav { padding: 0 1rem; }
    .ffl-nav-brand-text { display: none; }
    .ffl-nav-user { display: none; }
}

/* ════════════════════════════════════════════════
   SIDEBAR ADMIN — FFL Theme
   ════════════════════════════════════════════════ */

:root {
    --sidebar-w: 260px;
    --sidebar-collapsed: 68px;
}

/* ─── Layout wrapper ─── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.admin-layout.sidebar-collapsed .admin-content {
    margin-left: var(--sidebar-collapsed);
}

/* ─── Sidebar ─── */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-w);
    background: rgba(9, 18, 38, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid rgba(201,168,76,0.12);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: width 0.3s ease;
    overflow: hidden;
}

.admin-layout.sidebar-collapsed .admin-sidebar {
    width: var(--sidebar-collapsed);
}

/* ─── Brand ─── */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1rem 1rem;
    border-bottom: 1px solid rgba(201,168,76,0.08);
    flex-shrink: 0;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

.sidebar-brand-link img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(201,168,76,0.4);
    flex-shrink: 0;
}

.sidebar-brand-name {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cream);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-name b { color: var(--gold); font-style: normal; }

.sidebar-brand-role {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(201,168,76,0.55);
    margin-top: 1px;
}

.sidebar-toggle {
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.15);
    border-radius: 8px;
    color: rgba(201,168,76,0.6);
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.sidebar-toggle:hover {
    background: rgba(201,168,76,0.15);
    color: var(--gold);
}

.admin-layout.sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

/* ─── User Card ─── */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.9rem 1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, #a07c30 100%);
    color: var(--navy);
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cream);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-tag {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(201,168,76,0.5);
    margin-top: 1px;
}

/* ─── Divider ─── */
.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.12), transparent);
    margin: 0.2rem 0;
    flex-shrink: 0;
}

/* ─── Navigation ─── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,168,76,0.15) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.15); border-radius: 2px; }

.sidebar-section {
    padding: 0.5rem 0 0.3rem;
}

.sidebar-section-label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(201,168,76,0.35);
    padding: 0.5rem 1.1rem 0.3rem;
    white-space: nowrap;
    overflow: hidden;
}

/* ─── Sidebar Link ─── */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1rem 0.6rem 1.1rem;
    text-decoration: none;
    color: rgba(245,237,216,0.55);
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.sidebar-link:hover {
    color: var(--cream);
    background: rgba(201,168,76,0.06);
}

.sidebar-link.active {
    color: var(--gold);
    background: rgba(201,168,76,0.1);
    border-right: 2px solid var(--gold);
}

.sidebar-link.active .sidebar-icon {
    color: var(--gold);
}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: rgba(201,168,76,0.45);
    transition: color 0.2s;
}

.sidebar-link:hover .sidebar-icon { color: var(--cream); }
.sidebar-link.active .sidebar-icon { color: var(--gold); }

.sidebar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
}

.sidebar-active-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    margin-left: auto;
    flex-shrink: 0;
}

/* ─── Logout link ─── */
.sidebar-logout {
    color: rgba(248,113,113,0.5);
}

.sidebar-logout:hover {
    color: #f87171;
    background: rgba(248,113,113,0.06);
}

.sidebar-logout .sidebar-icon { color: rgba(248,113,113,0.4); }
.sidebar-logout:hover .sidebar-icon { color: #f87171; }

/* ─── Bottom ─── */
.sidebar-bottom {
    padding: 0.5rem 0;
    border-top: 1px solid rgba(201,168,76,0.08);
    flex-shrink: 0;
}

/* ─── Collapsed State ─── */
.admin-layout.sidebar-collapsed .sidebar-label,
.admin-layout.sidebar-collapsed .sidebar-section-label,
.admin-layout.sidebar-collapsed .sidebar-user-info,
.admin-layout.sidebar-collapsed .sidebar-brand-name,
.admin-layout.sidebar-collapsed .sidebar-brand-role,
.admin-layout.sidebar-collapsed .sidebar-active-dot {
    opacity: 0;
    pointer-events: none;
    width: 0;
}

.admin-layout.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.7rem;
}

.admin-layout.sidebar-collapsed .sidebar-user {
    justify-content: center;
}

/* ─── Overlay Móvil ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    backdrop-filter: blur(4px);
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .admin-content {
        margin-left: 0 !important;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease, width 0.3s ease;
        width: var(--sidebar-w) !important;
    }

    .admin-layout.mobile-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-layout.mobile-open .sidebar-overlay {
        display: block;
    }

    .sidebar-label,
    .sidebar-section-label,
    .sidebar-user-info,
    .sidebar-brand-name,
    .sidebar-brand-role {
        opacity: 1 !important;
        width: auto !important;
        pointer-events: auto !important;
    }
}

/* ─── Sidebar Top Nav for Mobile ─── */
.sidebar-mobile-toggle {
    display: none;
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.15);
    border-radius: 8px;
    color: var(--gold);
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-mobile-toggle:hover {
    background: rgba(201,168,76,0.15);
}

@media (max-width: 768px) {
    .sidebar-mobile-toggle { display: flex; align-items: center; }
}
