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

:root {
    --primary: #1e293b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --bg-input: #f8fafc;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Inter', sans-serif; 
    background: #f1f5f9; 
    color: #334155; 
    padding: 20px; 
    line-height: 1.5;
    /* Activează centrarea flexibilă pentru paginile de login/demo pe PC */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* CONTAINER PRINCIPAL (Orar/Admin) */
.container-card { 
    background: #ffffff; 
    width: 100%;
    max-width: 1100px; 
    margin: 20px auto; 
    padding: 30px; 
    border-radius: 20px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); 
}

/* LOGIN BOX - Fix pentru centrarea pe PC */
.login-box { 
    background: #ffffff;
    width: 100%;
    max-width: 450px; 
    margin: auto auto; /* Centrează vertical și orizontal pe tot ecranul */
    padding: 35px; 
    border-radius: 20px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

header { text-align: center; margin-bottom: 30px; border-bottom: 1px solid #f1f5f9; padding-bottom: 20px; }
header h1 { color: var(--primary); font-size: 2rem; font-weight: 800; }
header h2 { color: #64748b; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }

/* --- FORMULARE --- */
.form-section {
    background: #f8fafc; 
    padding: 25px; 
    border-radius: 16px; 
    border: 1px solid #e2e8f0; 
    margin-bottom: 30px;
}

/* Structură implicită pentru telefoane/tablete */
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    align-items: flex-end;
}

/* Structură dedicată pentru ecrane mari (PC) pentru a afișa integral clasele cu nume lungi */
@media (min-width: 992px) {
    .grid-form {
        /* Alocăm 1.8 părți de spațiu pentru Clasă/Materie și doar 1 parte pentru Zi/Ore */
        grid-template-columns: 1.8fr 1fr 1.8fr 1fr 1fr auto;
    }
}

.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-group label, .form-group label { 
    font-size: 0.75rem; 
    font-weight: 700; 
    color: #64748b; 
    text-transform: uppercase; 
    margin-bottom: 4px;
}

/* Stil unitar pentru toate câmpurile de intrare */
.modern-input, input[type="text"], input[type="password"], input[type="time"], select {
    width: 100%; 
    padding: 12px 10px; /* Padding redus lateral */
    border: 2px solid #e2e8f0; 
    border-radius: 12px; 
    font-family: inherit; 
    font-size: 0.9rem; 
    transition: all 0.2s ease; 
    background: white; 
    outline: none;
}

.modern-input:focus, input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Asigurăm afișarea optimă a textului lung în interiorul casetei select */
select.modern-input, select {
    text-overflow: clip; 
    padding-right: 5px;  
}

/* --- TABELE ȘI SEPARARE ZILE --- */
.table-container { 
    overflow-x: auto; 
    margin: 20px 0; 
    border-radius: 12px; 
    border: 1px solid #e2e8f0; 
}

table { width: 100%; border-collapse: collapse; min-width: 700px; }
th { background: #f8fafc; padding: 15px; text-align: left; color: #64748b; font-size: 0.75rem; text-transform: uppercase; border-bottom: 2px solid #edf2f7; }
td { padding: 15px; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; }

/* Separator albastru pentru zile */
.day-separator { border-top: 3px solid var(--accent) !important; }

/* Zebra striping */
tbody tr:nth-child(even) { background-color: #fafbfc; }
tbody tr:hover { background-color: #f1f5f9; }

.day-cell { background: #f8fafc; font-weight: 700; color: var(--accent); text-align: center; vertical-align: middle; }
.class-header { background: var(--primary); color: white; font-weight: 700; text-align: center; padding: 12px; font-size: 1rem; }

/* --- BUTOANE --- */
.btn { 
    padding: 12px 24px; border-radius: 12px; border: none; cursor: pointer; 
    font-weight: 600; font-size: 0.9rem; transition: 0.3s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; width: 100%; } 
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-danger { background: #fee2e2; color: #ef4444; border: 1px solid #fecaca; }
.btn-auto { width: auto; } /* Folosit pentru butoanele de ștergere/ieșire pentru a nu fi late */

/* --- STATUS --- */
.status-msg { padding: 12px; border-radius: 10px; margin-bottom: 20px; font-size: 0.9rem; text-align: center; }
.success { background: #dcfce7; color: #166534; }
.error { background: #fee2e2; color: #991b1b; }

.preview-section { margin-top: 40px; padding-top: 30px; border-top: 2px dashed #cbd5e1; display: none; }

/* --- FOOTER --- */
.footer-link { text-align: center; margin-top: auto; padding-top: 20px; font-size: 0.85rem; color: #64748b; }
.footer-link a { color: var(--accent); text-decoration: none; font-weight: 600; }