@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #002d5a;
    --primary-light: #004b93;
    --primary-electric: #006aff;
    --accent: #ffcc00;
    --secondary: #6c5ce7;
    --bg-body: #f0f3f7;
    --text-main: #1a1c1e;
    --text-light: #6b7280;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --shadow-lg: 0 10px 40px rgba(0, 51, 102, 0.12);
    --radius: 20px;
    --radius-sm: 12px;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex; /* Natural horizontal layout on PC */
    min-height: 100vh;
}

/* Sidebar PC Default */
.sidebar {
    width: 280px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s, color 0.4s;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
}


.sidebar-header {
    padding: 0 2rem;
    margin-bottom: 3rem;
    text-align: center;
}

.main-logo {
    width: 80px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.sidebar-header h2 {
    display: none; /* Oculto por redundancia con la cabecera */
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.sidebar-header p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0 1rem 5rem;
}

.nav-item {
    width: 100%;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-item::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-item:hover {
    background: rgba(0, 51, 102, 0.05);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.2);
}

.nav-item.active::before {
    opacity: 1;
    background: var(--white);
}

.nav-group-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: 0.1rem;
    margin: 1.5rem 1.5rem 0.5rem;
    padding-top: 0.5rem;
    opacity: 0.7;
    text-transform: uppercase;
}

/* Interactividad para el Escudo/Logo */
.js-school-logo {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s;
}

.js-school-logo:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

.js-school-logo:active {
    transform: scale(0.95);
}

.nav-group-label:first-child {
    margin-top: 0;
}

/* Base Accordion Trigger - Blue (Default) */
.nav-accordion-trigger {
    width: calc(100% - 2rem);
    margin: 0.5rem 1rem;
    padding: 1.1rem 1.4rem;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.nav-accordion-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.08);
    border-color: var(--primary-light);
}

/* La regla .open se maneja de forma individual más abajo para no sobreescribir colores */

/* Video Accordion Trigger - Orange Theme */
.nav-accordion-trigger.video-trigger {
    color: #e67e22;
}

.nav-accordion-trigger.video-trigger:hover {
    border-color: #e67e22;
    background: rgba(230, 126, 34, 0.02);
}

.nav-accordion-trigger.video-trigger.open {
    background: rgba(230, 126, 34, 0.05);
}

.nav-accordion-trigger.video-trigger.open .arrow-icon {
    color: #e67e22;
}

/* Meeting Accordion Trigger - Emerald Green Theme */
.nav-accordion-trigger.meeting-trigger {
    color: #27ae60;
}

.nav-accordion-trigger.meeting-trigger:hover {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.02);
}

.nav-accordion-trigger.meeting-trigger.open {
    background: rgba(39, 174, 96, 0.05);
}

.nav-accordion-trigger.meeting-trigger.open .arrow-icon {
    color: #27ae60;
}

/* ACLE Accordion Trigger - Purple Theme */
.nav-accordion-trigger.acle-trigger {
    color: #8e44ad;
}

.nav-accordion-trigger.acle-trigger:hover {
    border-color: #8e44ad;
    background: rgba(142, 68, 173, 0.02);
}

.nav-accordion-trigger.acle-trigger.open {
    background: rgba(142, 68, 173, 0.05);
}

.nav-accordion-trigger.acle-trigger.open .arrow-icon {
    color: #8e44ad;
}

.nav-accordion-trigger .arrow-icon {
    font-size: 0.8rem;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.nav-accordion-trigger.open {
    background: var(--bg-body);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}


.nav-accordion-trigger.open .arrow-icon {
    transform: rotate(180deg);
}

/* Accordion Content */
.nav-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
    margin: 0 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.nav-group-content.video-content {
    background: rgba(230, 126, 34, 0.02);
}

.nav-group-content.meeting-content {
    background: rgba(39, 174, 96, 0.02);
}

.nav-group-content.acle-content {
    background: rgba(142, 68, 173, 0.02);
}

.nav-group-content.open {
    max-height: 1000px;
    transition: max-height 0.8s ease-in-out;
    padding-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: none;
}

.nav-group-content .nav-item {
    width: 100%;
    margin-bottom: 0;
    border-radius: 0;
    padding: 1.1rem 1.5rem;
    font-size: 1rem;
}

.nav-group-content.video-content .nav-item.active {
    background: #e67e22 !important;
    color: white !important;
}

.nav-group-content.meeting-content .nav-item.active {
    background: #27ae60 !important;
    color: white !important;
}

.nav-group-content.acle-content .nav-item.active {
    background: #8e44ad !important;
    color: white !important;
}

/* Recent Updates Widget Removido */



.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid rgba(0,0,0,0.03);
}


.recent-item:hover {
    transform: translateX(5px);
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.recent-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f0f7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--primary);
}

.recent-info {
    flex: 1;
    overflow: hidden;
}

.recent-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-meta {
    font-size: 0.7rem;
    color: var(--text-light);
}

.nav-group-content .nav-item.active {
    background: var(--primary-light);
    color: white;
}

/* Meeting Cards - Calendar Style */
.meeting-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    padding: 0 !important;
    overflow: hidden;
    border-left: 8px solid #27ae60 !important;
    background: var(--glass) !important;
    backdrop-filter: blur(12px);
    border-radius: var(--radius) !important;
}

.meeting-calendar-icon {
    background: #f1fcf4;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    border-right: 1px solid rgba(0,0,0,0.05);
}

.meeting-day-name {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #27ae60;
    margin-bottom: 2px;
}

.meeting-day-num {
    font-size: 2rem;
    font-weight: 900;
    color: #2c3e50;
    line-height: 1;
}

.meeting-details {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.meeting-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--primary);
}

.meeting-info-row {
    font-size: 0.85rem;
    color: #636e72;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
}

.meeting-info-row i {
    width: 18px;
    margin-right: 8px;
    color: #27ae60;
    font-size: 0.9rem;
}

/* ACLE Cards - Workshop Style */
.acle-card {
    border-top: 8px solid #8e44ad !important;
    position: relative;
    padding-top: 2.5rem !important;
    background: var(--glass) !important;
    backdrop-filter: blur(12px);
    border-radius: var(--radius) !important;
}

.acle-badge {
    position: absolute;
    top: 0;
    right: 1.5rem;
    background: #8e44ad;
    color: white;
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.acle-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.acle-icon-circle {
    width: 45px;
    height: 45px;
    background: #f7f1fb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: #8e44ad;
    font-size: 1.2rem;
}

.acle-card h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary);
}

.acle-instructor {
    display: block;
    font-size: 0.9rem;
    color: #636e72;
    margin-top: 2px;
}

.acle-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.acle-detail-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #2d3436;
}

.acle-detail-item i {
    width: 20px;
    margin-right: 10px;
    color: #8e44ad;
    opacity: 0.7;
}

/* Ensure Simona uses the new cards too */
.simona-message .meeting-card, 
.simona-message .acle-card {
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    background: white;
}

/* --- Search Result Navigation Buttons --- */
.meeting-search-nav {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed rgba(0,0,0,0.05);
}

.btn-search-nav-text {
    background: none;
    border: none;
    color: var(--primary-electric);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-search-nav-text:hover {
    color: var(--primary);
    transform: translateX(3px);
}

.btn-search-nav {
    width: 100%;
    padding: 0.6rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-search-nav:hover {
    background: var(--primary-electric);
    transform: translateY(-2px);
}

/* --- PDF / Circular Cards - Document Style --- */
.pdf-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    padding: 0 !important;
    overflow: hidden;
    border-left: 8px solid var(--primary-electric) !important;
    background: var(--glass) !important;
    backdrop-filter: blur(12px);
    border-radius: var(--radius) !important;
}

.pdf-details {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.pdf-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--primary);
    line-height: 1.3;
}

.pdf-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.pdf-actions .btn-view, .pdf-actions .btn-download-sm {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
}

.content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    transition: margin 0.3s;
    min-height: 100vh;
}

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

.header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 60px;
}

.welcome-text-container h1 {
    font-size: 1.6rem;
    line-height: 1.1;
    margin-bottom: 2px;
}

.welcome-text-container p {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Search Bar Styles */
.search-container {
    flex: 1;
    max-width: 450px;
    margin: 0 2rem;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

#global-search {
    width: 100%;
    padding: 0.9rem 1.5rem 0.9rem 3rem;
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.95rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

#global-search:focus {
    outline: none;
    border-color: var(--primary-electric);
    box-shadow: 0 0 0 4px rgba(0, 106, 255, 0.1);
    background: white;
}


.current-month-display {
    background: var(--white);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    box-shadow: var(--shadow);
    font-weight: 600;
    color: var(--primary);
}

.document-section {
    max-width: 1000px;
    margin: 0 auto;
}

.section-banner {
    background: var(--glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 180px;
    padding: 2rem 3rem;
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
    border: 1px solid var(--glass-border);
    border-left: 8px solid var(--primary-electric);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    transition: border-left-color 0.4s ease;
}

.section-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(230, 184, 0, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.section-banner h2, .section-banner p {
    position: relative;
    z-index: 1;
}

.section-banner h2 {
    font-size: 2.2rem;
    margin-bottom: 4px;
    color: var(--primary);
    transition: color 0.4s ease;
}

.section-banner p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.doc-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    padding: 1.8rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.doc-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: var(--shadow-lg);
    background: white;
    border-color: var(--primary-electric);
}

.doc-info h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary);
    line-height: 1.4;
}

.doc-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.doc-actions {
    display: flex;
    gap: 0.8rem;
}

.btn-view, .btn-download-sm {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
    flex: 1;
    text-align: center;
    border: none;
}

.btn-view {
    background: var(--primary);
    color: white;
}

.btn-download-sm {
    background: #f0f4f8;
    color: var(--primary);
    border: 1px solid #d1d9e6;
}

.btn-view:hover { background: var(--primary-light); }
.btn-download-sm:hover { background: #e2e8f0; }

/* Image helper */
img {
    max-width: 100%;
    height: auto;
}

/* Mobile Utilities hidden on PC */
.mobile-header {
    display: none;
}

.mobile-only {
    display: none;
}

/* --- RESPONSIVE LOGIC --- */

/* Tablets (max-width: 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
        z-index: 300; /* Asegurar que cubra el header móvil! */
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: inline-block !important;
    }

    .mobile-header {
        display: flex !important;
        background: var(--primary);
        color: white;
        padding: 1rem 1.5rem;
        position: sticky;
        top: 0;
        z-index: 200;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        justify-content: flex-start !important; /* Aligned to the left */
        gap: 1.5rem !important; /* Space between menu and brand */
        align-items: center;
        width: 100% !important;
    }

    .mobile-brand {
        display: flex !important;
        align-items: center;
        gap: 0.8rem;
        flex: 0 1 auto !important;
        margin-right: auto !important;
    }

    .mobile-text-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .mobile-greeting {
        font-size: 1.1rem;
        font-weight: 700;
        color: white;
        line-height: 1.1;
        text-transform: none;
        letter-spacing: normal;
    }

    .mobile-brand h1 {
        font-size: 1.1rem;
        font-weight: 700;
        line-height: 1.1;
    }
    
    .mini-logo { width: 40px; }

    #menu-toggle {
        flex: 0 0 auto !important;
        background: transparent;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
        transition: color 0.3s ease;
    }

    @keyframes menuPulse {
        0% { box-shadow: 0 0 0 0 rgba(230, 184, 0, 0.8); background: transparent; }
        70% { box-shadow: 0 0 0 15px rgba(230, 184, 0, 0); background: rgba(230, 184, 0, 0.15); }
        100% { box-shadow: 0 0 0 0 rgba(230, 184, 0, 0); background: transparent; }
    }

    .menu-highlight {
        animation: menuPulse 2s infinite;
        border-radius: 8px;
        color: var(--accent) !important; /* Resaltar icono en amarillo */
    }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 16px; /* Base legibility */
        line-height: 1.6;
    }

    .app-container {
        flex-direction: column; /* Force vertical flow */
    }

    .sidebar {
        width: 85%;
    }

    .sidebar-header {
        padding: 0 1rem;
        margin-bottom: 2rem;
    }

    .nav-item {
        padding: 1.25rem 1.5rem; /* Larger touch targets */
        font-size: 1.1rem;
    }

    .content {
        padding: 1rem;
    }

    .section-banner {
        padding: 1.5rem;
        border-radius: 8px;
    }

    .section-banner h2 {
        font-size: 1.5rem;
    }

    .document-grid {
        grid-template-columns: 1fr; /* Single column */
        gap: 1.2rem;
    }

    .doc-card {
        padding: 1.5rem;
    }

    .doc-actions {
        flex-direction: row; /* Mantener horizontal si es posible, o stack si es muy pequeño */
        gap: 0.5rem;
    }

    .btn-view, .btn-download-sm {
        padding: 0.9rem 0.5rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    /* Mejora de tarjetas de reunión en móvil ultra pequeño */
    @media (max-width: 360px) {
        .meeting-card {
            flex-direction: column !important;
        }
        .meeting-calendar-icon {
            flex-direction: row;
            min-width: 100%;
            padding: 0.8rem;
            justify-content: flex-start;
            gap: 1rem;
            border-right: none;
            border-bottom: 1px solid rgba(0,0,0,0.05);
        }
        .meeting-day-num {
            font-size: 1.4rem;
        }
        .meeting-details {
            padding: 1rem;
        }
        .acle-badge {
            right: 0.5rem;
            font-size: 0.6rem;
        }
    }
}

/* Landscape (celular horizontal) */
@media (max-height: 500px) and (orientation: landscape) {
    
    .app-container {
        flex-direction: column;
    }

    /* --- Header ultra compacto --- */
    .mobile-header {
        padding: 0.3rem 0.8rem;
        min-height: auto;
    }

    .mobile-brand h1 {
        font-size: 0.9rem;
    }

    .mini-logo {
        width: 22px;
    }

    #menu-toggle {
        font-size: 1.2rem;
        padding: 0.3rem;
    }

    /* --- Sidebar compacta con scroll --- */
    .sidebar {
        width: 220px;
        padding: 0.5rem 0;
    }

    .sidebar-header {
        margin-bottom: 0.5rem;
        padding: 0 0.8rem;
    }

    .main-logo {
        width: 30px;
        margin-bottom: 0.3rem;
    }

    .sidebar-header h2 {
        font-size: 0.9rem;
    }

    .sidebar-header p {
        font-size: 0.65rem;
    }

    .sidebar-nav {
        padding: 0 0.5rem 1rem;
    }

    .nav-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }

    .nav-item::before {
        display: none;
    }

    /* --- Contenido principal con scroll --- */
    .content {
        padding: 0.5rem 0.8rem;
        overflow-y: auto;
        height: calc(100dvh - 36px);
    }

    .section-banner {
        padding: 0.6rem 1rem;
        margin-bottom: 0.5rem;
    }

    .section-banner h2 {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }

    .section-banner p {
        font-size: 0.8rem;
    }

    .section-banner::after {
        display: none;
    }

    .document-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 0.5rem;
    }

    .doc-card {
        padding: 0.8rem;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .doc-info h3 {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .doc-date {
        font-size: 0.75rem;
        margin-bottom: 0;
    }

    .doc-actions {
        flex-direction: row;
        gap: 0.4rem;
        flex-shrink: 0;
    }

    .btn-view, .btn-download-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    /* --- Chat en landscape: pantalla completa --- */
    .chat-container {
        width: 100%;
        height: 100dvh;
        bottom: 0;
        right: 0;
        top: 0;
        left: 0;
        border-radius: 0;
    }

    .chat-container .chat-header {
        padding: 0.4rem 0.8rem;
    }

    .chat-container .chat-header-info h3 {
        font-size: 0.9rem;
    }

    .chat-container .simona-avatar {
        width: 28px;
        height: 28px;
    }

    .chat-container .message {
        font-size: 0.85rem;
        padding: 0.5rem 0.7rem;
        border-radius: 12px;
    }

    .chat-container .chat-messages {
        padding: 0.4rem 0.6rem;
        gap: 0.3rem;
    }

    .chat-container .chat-input-area {
        padding: 0.4rem 0.6rem;
    }

    .chat-container #chat-input {
        padding: 0.5rem 0.8rem;
        font-size: 14px;
    }

    .chat-container #send-chat {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    /* --- Botón Simona más pequeño --- */
    .chat-trigger {
        width: 45px;
        height: 45px;
        bottom: 0.5rem;
        right: 0.5rem;
    }

    /* --- Welcome container en landscape --- */
    .welcome-container {
        padding: 1.5rem 1rem !important;
    }

    .welcome-container img {
        width: 60px !important;
        margin-bottom: 0.5rem !important;
    }

    .welcome-container h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.3rem !important;
    }

    .welcome-container p {
        font-size: 0.9rem !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0; /* Star hidden for animation */
}

/* Better Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* --- CHATBOT SIMONA STYLES --- */
@keyframes simonaPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(16, 163, 127, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 163, 127, 0); }
}

.chat-trigger {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d7c66, #10a37f);
    border: 3px solid var(--white);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    animation: simonaPulse 2s infinite;
}

.chat-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 30px rgba(16, 163, 127, 0.4);
}

.simona-trigger-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 50%;
}



.chat-container {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: min(380px, 95vw);
    height: min(520px, 80vh);
    background: #f8f9fb;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.chat-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    background: linear-gradient(135deg, #0d7c66, #10a37f);
    color: white;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.simona-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(230, 184, 0, 0.3);
    background: white;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.chat-header-info div {
    display: flex;
    flex-direction: column;
}

.chat-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    margin-right: 5px;
    animation: statusBlink 2s infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chat-header-info h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.chat-header-info span {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.85;
}

/* --- VIDEO MODAL STYLES --- */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none; /* Oculto por defecto */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    background: #1e1e1e;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Instagram modal: más angosto y alto para mostrar publicación completa */
.modal-content.instagram-modal {
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
}

.video-modal.active .modal-content {
    transform: translateY(0);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Default for YouTube */
    height: 0;
    background: #000;
    transition: padding-bottom 0.4s ease;
}

/* Instagram: publicación completa con caption y comentarios */
.video-wrapper.instagram-ratio {
    padding-bottom: 0;
    height: 80vh;
    max-height: 800px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Instagram iframe no necesita position absolute */
.video-wrapper.instagram-ratio iframe {
    position: relative;
    height: 100%;
    border: none;
}

.modal-info {
    padding: 1.5rem 2rem;
    color: white;
}

.modal-info h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #f1c40f;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2010;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.close-modal:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(90deg);
}

/* YouTube specific card styling (PREMIUM) */
.doc-card.video-card:not(:has(.fa-instagram)) {
    border-left: 5px solid #FF0000 !important;
}

.doc-card.video-card:not(:has(.fa-instagram)) .btn-view {
    background: linear-gradient(135deg, #FF0000, #b30000) !important;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.2);
}

.doc-card.video-card:not(:has(.fa-instagram)) .video-icon-preview {
    color: #FF0000;
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.2));
}

.doc-card.video-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Instagram specific card styling */
.doc-card.video-card:has(.fa-instagram) {
    border-left: 5px solid #E1306C !important;
}

.doc-card.video-card:has(.fa-instagram) .btn-view {
    background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D) !important;
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
}

.doc-card.video-card:has(.fa-instagram) .video-icon-preview {
    color: #C13584;
    filter: drop-shadow(0 0 10px rgba(193, 53, 132, 0.2));
}

#close-chat {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

#close-chat:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.chat-messages {
    flex: 1;
    padding: 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: #f8f9fb;
}

.message {
    padding: 0.8rem 1.1rem;
    border-radius: 18px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    animation: messageSlide 0.3s ease forwards;
    word-wrap: break-word;
}

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

.bot-message {
    align-self: flex-start;
    background: white;
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #0d7c66, #10a37f);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 4px rgba(13, 124, 102, 0.25);
}

.chat-input-area {
    padding: 0.8rem 1rem;
    background: white;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.03);
}

#chat-input {
    flex: 1;
    border: 1.5px solid #e1e8ef;
    background: #f4f7fa;
    padding: 0.75rem 1.1rem;
    border-radius: 25px;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

#chat-input:focus {
    border-color: #10a37f;
    background: white;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.15);
}

#send-chat {
    background: linear-gradient(135deg, #0d7c66, #10a37f);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#send-chat:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #0a6b58, #0d8f6e);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

/* Responsive adjustment for chat */
@media (max-width: 480px) {
    .chat-container {
        width: 100%;
        height: 100dvh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        top: 0;
        left: 0;
        overflow: hidden;
    }

    .chat-header {
        padding: 1rem 1.2rem;
        border-radius: 0;
    }

    .chat-header-info h3 {
        font-size: 1.1rem;
    }

    .chat-header-info span {
        font-size: 0.85rem;
    }

    .chat-messages {
        padding: 1rem;
        gap: 0.8rem;
    }

    .message {
        font-size: 1.1rem;
        line-height: 1.5;
        padding: 1rem 1.2rem;
        max-width: 90%;
    }

    .chat-input-area {
        padding: 0.8rem 1rem;
        padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
        gap: 0.6rem;
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 1px solid rgba(0,0,0,0.08);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }

    #chat-input {
        font-size: 16px; /* Previene zoom automático en iOS */
        padding: 0.9rem 1.2rem;
        border-radius: 20px;
    }

    #send-chat {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 1.1rem;
    }

    .simona-avatar {
        width: 35px;
        height: 35px;
    }
}

/* --- Toast Notifications --- */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: white;
    padding: 0.9rem 1.5rem;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.toast-info {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

/* --- Links de documentos en el chat --- */
.chat-doc-link {
    display: inline-block;
    background: #f0f4f8;
    color: var(--primary);
    text-decoration: none;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s, transform 0.2s;
    border: 1px solid #d1d9e6;
}

.chat-doc-link:hover {
    background: #dbe4ee;
    transform: translateX(3px);
}

.chat-doc-link i {
    color: #e74c3c;
    margin-right: 4px;
}

/* --- Typing Indicator --- */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    align-items: center;
    background: white;
    width: fit-content;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    margin-bottom: 0.8rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    animation: messageSlide 0.3s ease forwards;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #bdc3c7;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* --- Chat Suggestions --- */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.8rem;
    margin-bottom: 0.4rem;
}

.suggestion-btn {
    background: white;
    border: 1.5px solid #10a37f;
    color: #0d7c66;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, #0d7c66, #10a37f);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 163, 127, 0.25);
}

/* --- Proactive Bubble --- */
.proactive-bubble {
    position: fixed;
    bottom: 6.5rem;
    right: 2.5rem;
    background: linear-gradient(135deg, #0d7c66, #10a37f);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 220px;
    box-shadow: 0 8px 25px rgba(16, 163, 127, 0.25);
    z-index: 998;
    animation: bubbleBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    cursor: pointer;
}

.proactive-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 15px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #10a37f;
}

@keyframes bubbleBounce {
    from { opacity: 0; transform: translateY(20px) scale(0.8); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Feedback System --- */
.feedback-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 5px;
    margin-left: 5px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.feedback-container:hover {
    opacity: 1;
}

.feedback-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.feedback-btn:hover {
    background: #e1e8ef;
    color: var(--primary);
}

.feedback-btn.active-up { color: #27ae60; background: rgba(39, 174, 96, 0.1); }
.feedback-btn.active-down { color: #e74c3c; background: rgba(231, 76, 60, 0.1); }

/* --- Document Carousel --- */
.doc-carousel {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 0.5rem 0.2rem 0.8rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.doc-carousel::-webkit-scrollbar {
    height: 4px;
}

.doc-carousel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.doc-carousel-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    background: linear-gradient(135deg, #f0f4f8, #e8edf2);
    border: 1px solid #d1d9e6;
    border-radius: 12px;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.doc-carousel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-light);
}

.doc-carousel-card .card-icon {
    font-size: 2rem;
    color: #e74c3c;
}

.doc-carousel-card .card-title {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary);
}

.doc-carousel-card .card-date {
    font-size: 0.7rem;
    color: var(--text-light);
}

/* --- Emergency Message --- */
.emergency-box {
    background: linear-gradient(135deg, #fff5f5, #ffe0e0);
    border: 1.5px solid #e74c3c;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.emergency-box a {
    display: inline-block;
    background: #e74c3c;
    color: white !important;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    transition: background 0.2s;
}

.emergency-box a:hover {
    background: #c0392b;
}

/* --- "Did you mean?" Fuzzy --- */
.fuzzy-suggestion {
    display: inline-block;
    background: rgba(16, 163, 127, 0.08);
    border: 1px dashed #10a37f;
    color: #0d7c66;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0.3rem 0.2rem;
    transition: all 0.2s;
}

.fuzzy-suggestion:hover {
    background: linear-gradient(135deg, #0d7c66, #10a37f);
    color: white;
    border-color: #10a37f;
}

/* --- Conversation History --- */
.history-box {
    background: linear-gradient(135deg, #f8f9fb, #edf2f7);
    border: 1px solid #d1d9e6;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.3rem;
}

.history-box ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.history-box li {
    padding: 0.3rem 0;
    font-size: 0.82rem;
    color: var(--text-light);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.history-box li:last-child {
    border-bottom: none;
}

.history-box li i {
    margin-right: 0.4rem;
    color: var(--primary-light);
}

/* --- Rich Message Formatting --- */
.bot-message ul {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}

.bot-message li {
    margin-bottom: 0.3rem;
}

.bot-message strong {
    color: var(--primary);
}
