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

:root {
    --primary: #fbbf24; /* Oro */
    --primary-hover: #f59e0b;
    --bg-color: #0f172a; /* Blu scuro elegante */
    --text-main: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #cbd5e1;
    --card-bg: rgba(30, 41, 59, 0.75);
    --border: rgba(255, 255, 255, 0.15);
    --today-bg: rgba(251, 191, 36, 0.1);
    --today-border: #fbbf24;
    --today-badge: #d97706;
    --input-bg: rgba(15, 23, 42, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Titillium Web', sans-serif;
}

body {
    /* Sfondo a tema "Notte prima degli esami" o istituzionale elegante */
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Dettagli decorativi di sfondo */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(251, 191, 36, 0.08), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(99, 102, 241, 0.08), transparent 40%);
    z-index: -1;
}

.logo-img {
    max-width: 140px;
    margin: 0 auto 1.5rem auto;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
    animation: fadeInDown 0.8s ease;
}

h1 {
    text-align: center;
    margin-bottom: 0.25rem;
    color: var(--primary);
    font-size: 2.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 4px 15px rgba(251, 191, 36, 0.25);
}

h1 i {
    margin-right: 10px;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: 1px;
}

.container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
}

.view-container {
    max-width: 750px;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 1.05rem;
}

label i {
    margin-right: 5px;
}

input[type="text"], input[type="date"] {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: white;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

input[type="text"]:focus, input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.15);
    background: rgba(15, 23, 42, 0.9);
}

input::placeholder {
    color: #64748b;
}

button {
    width: 100%;
    padding: 1.1rem;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

button i {
    margin-right: 8px;
}

button:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(1px);
}

.nav-links {
    margin-top: 2rem;
    text-align: center;
}

.nav-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s, text-shadow 0.3s;
    font-size: 1.1rem;
}

.nav-links a:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* View Page Styles */
.day-section {
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.day-header {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary);
}

.day-header i {
    margin-right: 10px;
}

.today-section {
    border: 2px solid var(--today-border);
    background: var(--today-bg);
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.15);
}

.today-section .day-header {
    border-bottom-color: rgba(251, 191, 36, 0.3);
}

.today-badge {
    background: var(--primary);
    color: #000;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

.student-list {
    list-style: none;
}

.student-item {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    transition: background 0.3s;
}

.student-item:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding-left: 10px;
}

.student-icon {
    color: var(--primary);
    margin-right: 15px;
    font-size: 1.2rem;
}

.student-item:last-child {
    border-bottom: none;
}

.student-name {
    font-weight: 600;
    font-size: 1.2rem;
    color: white;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    font-size: 1.1rem;
}

/* Message */
#message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    display: none;
    font-size: 1.1rem;
}

.msg-success {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border: 1px solid #34d399;
}

.msg-error {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid #f87171;
}

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

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

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    
    .container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .logo-img {
        max-width: 110px;
    }
    
    .day-header {
        font-size: 1.15rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .today-badge {
        align-self: flex-start;
    }
    
    input[type="text"], input[type="date"] {
        padding: 0.8rem;
    }
    
    button {
        padding: 0.9rem;
    }
}
