
:root {
    color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; -webkit-tap-highlight-color: transparent; }
body, html { background-color: #f4f7f6; color: #333; height: 100vh; height: 100dvh; overflow: hidden; }

.app-header {
    background-color: #003366; 
    /* Forțăm extinderea în sus pe sub baterie. Dacă telefonul nu are breton, adaugă minim 35px */
    padding-top: calc(10px + env(safe-area-inset-top, 35px)) !important; 
    padding-bottom: 15px;
    
    /* Celelalte setări pe care le aveai pentru header */
    display: flex;
    align-items: center;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.login-container { 
    display: flex; 
    align-items: center;          /* Centrează conținutul pe verticală */
    justify-content: flex-start;  /* Aliniază conținutul la stânga */
    padding-left: 8%;             /* Aproape de marginea stângă (lasă un pic de aer) */
    height: 100vh; height: 100dvh; 
    background-color: #003366; 
    position: relative; 
    overflow: hidden; 
}

/* Stiluri pentru video și filtru */
.login-video-bg { 
    position: absolute; top: 0; left: 0; 
    width: 100%; height: 100%; 
    object-fit: cover; 
    z-index: 0; 
}

/* Dacă video-ul e prea închis la culoare, filtrul ajută textul (#003366) să iasă în evidență */
.login-overlay { 
    position: absolute; top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(255, 255, 255, 0.2); 
    z-index: 1; 
}

/* Containerul invizibil pentru conținut */
.login-content { 
    position: relative; 
    z-index: 2; 
    text-align: left; /* Aliniază textul la stânga în interiorul containerului */
    width: 100%;
    max-width: 500px;
}

/* Aliniem wrapper-ul butonului de la Google la stânga */
.google-btn-wrapper { 
    display: flex; 
    justify-content: flex-start; 
}

.login-logo-wrapper {
    position: absolute;
    top: 50px; /* Distanța față de marginea de sus */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center; /* Centrează perfect orizontal */
    z-index: 3; /* Îl pune deasupra overlay-ului */
}

/* Dimensiunea logo-ului */
.login-logo {
    max-width: 180px; /* Poți ajusta mărimea logo-ului de aici */
    height: auto;
}

/* Animații Slide-Up & Fade-In (Opacitate 0 -> 1) */
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Clasele de control al animației în cascadă */
.anim-slide-up { 
    opacity: 0; 
    animation: slideUpFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}

/* Animații Slide-Up & Fade-In (Opacitate 0 -> 1) */
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Clasele de control al animației */
.anim-slide-up { 
    opacity: 0; /* Pornește invizibil */
    animation: slideUpFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}
.delay-1 { animation-delay: 0.2s; } /* Intră Logo-ul */
.delay-2 { animation-delay: 0.5s; } /* Intră "BINE AI" */
.delay-3 { animation-delay: 0.9s; } /* Intră "VENIT" */
.delay-4 { animation-delay: 1.3s; } /* Intră Butonul Google */

/* --- STRUCTURA APP SHELL & HEADER --- */
#mainApp { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.app-header { background-color: #003366; color: white; padding: 12px 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 10; display: flex; align-items: center; gap: 15px; }
.app-header h1 { font-size: 20px; margin: 0; }

.menu-btn { background: transparent; border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 6px; border-radius: 50%; transition: background-color 0.2s; }
.menu-btn:active { background-color: rgba(255, 255, 255, 0.2); }
.menu-btn i { font-size: 26px; }

/* --- MENIU LATERAL (DRAWER) & OVERLAY --- */
.menu-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; background-color: rgba(0, 0, 0, 0.5); z-index: 998; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.menu-overlay.open { opacity: 1; visibility: visible; }
.side-menu { position: fixed; top: 0; left: 0; width: 280px; max-width: 80vw; height: 100vh; height: 100dvh; background-color: #ffffff; z-index: 999; box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.side-menu.open { transform: translateX(0); }
.side-menu-header { background-color: #003366; color: white; padding: 35px 20px 25px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.profile-pic { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; border: 3px solid #ffffff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); margin-bottom: 12px; background-color: #e6f0fa; }
.profile-pic-large { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid #003366; box-shadow: 0 4px 15px rgba(0, 51, 102, 0.15); background-color: #e6f0fa; }
.side-menu-header h3 { font-size: 17px; font-weight: 600; margin: 0; line-height: 1.3; }
.side-menu-body { flex: 1; padding: 15px 12px; overflow-y: auto; }
.side-menu-footer { padding: 12px; border-top: 1px solid #eaeaea; background-color: #fafafa; }
.side-menu-btn { width: 100%; background: transparent; border: none; padding: 12px 15px; border-radius: 8px; display: flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 600; color: #003366; cursor: pointer; transition: background-color 0.2s; text-align: left; }
.side-menu-btn i { font-size: 22px; color: #003366; }
.side-menu-btn:hover, .side-menu-btn:active { background-color: #e6f0fa; }
.side-menu-btn.footer-btn { color: #555; font-weight: 500; font-size: 14px; }
.side-menu-btn.footer-btn i { color: #666; font-size: 20px; }
.side-menu-btn.footer-btn:hover, .side-menu-btn.footer-btn:active { background-color: #eeeeee; }

/* --- ZONA DE CONȚINUT --- */
.content-area { flex: 1; overflow-y: auto; padding-bottom: 80px; }
.container { padding: 15px; max-width: 600px; margin: 0 auto; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.section-title { font-size: 18px; margin-bottom: 15px; color: #003366; border-bottom: 2px solid #ddd; padding-bottom: 5px; }

/* --- DESIGN PENTRU CARDURI --- */
.card { background: white; padding: 15px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 15px; border-left: 5px solid #003366; }
.card h3 { font-size: 16px; margin-bottom: 8px; color: #111; }
.card p { font-size: 14px; color: #666; margin-bottom: 12px; line-height: 1.4; }
.badge { display: inline-block; padding: 6px 12px; border-radius: 20px; font-size: 11px; font-weight: bold; letter-spacing: 0.5px; }
.deadline-badge { background-color: #fff4e5; color: #d9534f; border: 1px solid #f5c6cb; }
.deadline-badge-none { background-color: #f8f9fa; color: #6c757d; border: 1px dashed #ced4da; }
.location-text { background-color: #f8f9fa; padding: 10px; border-radius: 8px; font-size: 13px; border: 1px solid #e9ecef; }
.action-btn { display: inline-block; background-color: #003366; color: white; text-decoration: none; padding: 10px 15px; border-radius: 8px; font-size: 14px; font-weight: bold; border: none; cursor: pointer; text-align: center; }

/* --- FORMULAR EVENIMENTE --- */
.event-form-group { margin-bottom: 18px; }
.event-form-group p { font-weight: bold; margin-bottom: 10px; color: #003366; font-size: 15px; }
.event-label { display: flex; align-items: center; margin-bottom: 10px; font-size: 14px; cursor: pointer; color: #444; }
.event-label input { margin-right: 10px; transform: scale(1.3); cursor: pointer; }
.event-card { cursor: pointer; transition: 0.2s; }
.event-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.event-card-header { display: flex; justify-content: space-between; align-items: center; }
.event-card-header h3 { margin: 0; }
.expand-icon { transition: transform 0.3s ease; color: #003366; }
.event-details-content { margin-top: 15px; border-top: 1px solid #eee; padding-top: 15px; }
.event-leaders { background: #f4f7f6; padding: 10px; border-radius: 6px; font-size: 13px; margin-bottom: 10px; border-left: 3px solid #003366; }
.event-leaders p { margin-bottom: 5px !important; color: #111; }

/* --- SECȚIUNEA MEMBRI DEPARTAMENT --- */
.leader-card { background: white; padding: 20px; border-radius: 12px; margin-bottom: 15px; position: relative; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border-top: 4px solid #003366; }
.leader-card h3 { margin-bottom: 8px; color: #111; font-size: 18px; }
.leader-card p { font-size: 13px; color: #555; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.leader-card p i { font-size: 16px; color: #003366; }
.leader-badge { position: absolute; top: 15px; right: 15px; background: #e6f0fa; color: #003366; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: bold; }
.coordinator-card { border-top-color: #00509e; }
.members-grid { display: flex; flex-direction: column; gap: 8px; }
.member-item { background: white; padding: 10px 15px; border-radius: 8px; display: flex; align-items: center; gap: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.04); }
.member-avatar { width: 38px; height: 38px; background: #003366; color: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 14px; letter-spacing: 1px; }
.member-info h4 { margin: 0; font-size: 15px; color: #222; }

/* --- JOC QUIZ --- */
.quiz-timer-container { background: #e9ecef; height: 10px; border-radius: 5px; margin-bottom: 15px; overflow: hidden; }
.quiz-timer-bar { background: #003366; height: 100%; width: 100%; transition: width 1s linear, background-color 0.5s; }
.quiz-image { width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; margin-bottom: 15px; background-color: #f8f9fa; border: 1px solid #eee; }
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-btn { background: #f8f9fa; border: 2px solid #ddd; padding: 14px; border-radius: 8px; font-size: 15px; cursor: pointer; transition: 0.2s; text-align: left; font-weight: bold; color: #333; }
.quiz-btn:hover:not(:disabled) { border-color: #003366; background: #e6f0fa; }
.quiz-btn.correct { background: #d4edda; border-color: #28a745; color: #155724; }
.quiz-btn.wrong { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.quiz-btn:disabled { cursor: not-allowed; opacity: 0.9; }
.leaderboard-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #ddd; }
.leaderboard-item b { color: #003366; }
.leaderboard-item span { background: #ffeb3b; color: #856404; padding: 2px 8px; border-radius: 12px; font-weight: bold; font-size: 12px; }
.spinner-pulse { width: 60px; height: 60px; background-color: #d9534f; border-radius: 100%; margin: 0 auto; animation: sk-scaleout 1.0s infinite ease-in-out; }
@keyframes sk-scaleout { 0% { transform: scale(0); } 100% { transform: scale(1.0); opacity: 0; } }

/* --- BUTOANE PLUTITOARE (Ședințe și Adăugare Postare) --- */
.floating-toggle-btn { display: none; position: fixed; bottom: 85px; right: 20px; background-color: #003366; color: white; border: none; padding: 12px 24px; border-radius: 30px; font-size: 14px; font-weight: bold; box-shadow: 0 4px 10px rgba(0, 51, 102, 0.4); cursor: pointer; z-index: 99; transform: translateZ(0); will-change: transform, opacity; animation: fabPopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.floating-toggle-btn:active { transform: scale(0.95); }

.floating-add-post-btn { display: none; position: fixed; bottom: 85px; right: 20px; width: 60px; height: 60px; background-color: #003366; color: white; border: none; border-radius: 50%; font-size: 32px; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0, 51, 102, 0.4); cursor: pointer; z-index: 99; transform: translateZ(0); will-change: transform, opacity; animation: fabPopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.floating-add-post-btn:active { transform: scale(0.95); background-color: #00509e; }

.floating-filter-btn { display: none; position: fixed; bottom: 85px; left: 20px; width: 60px; height: 60px; background-color: #003366; color: white; border: none; border-radius: 50%; font-size: 32px; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0, 51, 102, 0.4); cursor: pointer; z-index: 99; transform: translateZ(0); will-change: transform, opacity; animation: fabPopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.floating-filter-btn:active { transform: scale(0.95); background-color: #00509e; }
.floating-filter-btn i { font-size: 28px; }

@keyframes fabPopIn { 0% { opacity: 0; transform: scale(0.3); } 100% { opacity: 1; transform: scale(1); } }

/* --- BOTTOM NAVIGATION BAR --- */
.bottom-nav { background-color: white; display: flex; justify-content: space-around; padding: 10px 0 15px 0; border-top: 1px solid #e0e0e0; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); z-index: 100; position: relative; }
.nav-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #757575; flex: 1; }
.nav-item i { font-size: 24px; margin-bottom: 4px; transition: 0.2s; }
.nav-item span { font-size: 11px; font-weight: 600; }
.nav-item.active { color: #003366; } 
.nav-item.active i { transform: scale(1.1); }

/* --- POSTĂRI & MODALE --- */
.post-card { background: white; padding: 18px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 20px; border: 1px solid #eee; }
.post-header { display: flex; align-items: center; margin-bottom: 12px; gap: 12px; }
.post-header img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid #e6f0fa; }
.post-header-info h4 { margin: 0; font-size: 16px; color: #111; }
.post-header-info span { font-size: 12px; color: #777; }
.post-text { font-size: 14px; margin-bottom: 15px; color: #222; line-height: 1.5; white-space: pre-wrap; }
.post-media { width: 100%; border-radius: 8px; margin-bottom: 15px; max-height: 350px; object-fit: cover; background: #000; }
.post-actions { display: flex; gap: 20px; border-top: 1px solid #eee; padding-top: 12px; }
.post-action-btn { background: transparent; border: none; display: flex; align-items: center; gap: 6px; color: #666; font-size: 14px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.post-action-btn:active { transform: scale(0.95); }
.post-action-btn.liked { color: #d9534f; }
.post-action-btn.liked i { color: #d9534f; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); z-index: 2000; display: flex; justify-content: center; align-items: center; }
.modal-content { width: 92%; max-width: 500px; background: white; border-radius: 12px; padding: 20px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); }
.comment-item { display: flex; gap: 12px; }
.comment-item img { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; border: 1px solid #ddd; }
.comment-box { background: #f8f9fa; padding: 12px; border-radius: 12px; flex: 1; border: 1px solid #eee; }
.comment-box h5 { margin: 0 0 5px 0; font-size: 14px; color: #003366; }
.comment-box p { margin: 0; font-size: 13px; color: #333; line-height: 1.4; }

/* --- Stilizare Buton Upload Media --- */
.file-upload-label { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px 15px; background-color: #f8f9fa; border: 2px dashed #003366; border-radius: 12px; cursor: pointer; transition: all 0.3s ease; text-align: center; }
.file-upload-label:hover, .file-upload-label:active { background-color: #e6f0fa; }
.file-upload-label i { font-size: 38px; margin-bottom: 8px; color: #003366; transition: color 0.3s ease; }
.file-upload-label span { font-size: 14px; font-weight: 600; color: #444; word-break: break-all; }
.file-upload-label.has-file { background-color: #e8f5e9; border-color: #28a745; border-style: solid; }
.file-upload-label.has-file i { color: #28a745; }
.file-upload-label.has-file span { color: #155724; }

/* --- SPINNER DE ÎNCĂRCARE (SEMI-CERC) --- */
.loading-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(0, 51, 102, 0.15); /* Culoarea ștearsă a cercului de bază */
    border-top: 4px solid #003366; /* Culoarea plină care se rotește */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

/* Versiune mai mică pentru butoane sau liste înguste */
.loading-spinner-small {
    width: 22px;
    height: 22px;
    border-width: 3px;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- STILURI PENTRU BUTOANELE DE ADMINISTRARE DIN MENIU --- */
.admin-menu-item {
    display: none; /* Sunt ascunse inițial, le arată app.js doar liderilor */
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    text-decoration: none;
    font-size: 16px;
    color: #003366 !important; 
    font-weight: 600;
    background-color: rgba(0, 51, 102, 0.04); /* Un fundal foarte fin albastru */
    border-left: 4px solid #003366; /* Linia care arată că e meniu special */
    margin-bottom: 5px;
    transition: background-color 0.2s;
}

.admin-menu-item:hover {
    background-color: rgba(0, 51, 102, 0.1);
}

.admin-menu-item .material-icons {
    color: #003366;
    font-size: 22px;
}