/* ========================================
   MOBILE FIRST CSS - Cronache Valkora
   ======================================== */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Mobile (320px+) */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    color: #333;
    font-size: 14px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

/* Login Container */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
    animation: slideIn 0.5s ease;
}

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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.login-header p {
    color: #6b7280;
    font-size: 1rem;
}

.login-form {
    margin-bottom: 20px;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    border: 2px solid #fecaca;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.login-footer p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Header Mobile */
.header {
    color: #fff;
    margin-bottom: 20px;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.header h1 {
    font-size: 1.4rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
    background: rgba(220, 38, 38, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.select-field {
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Statistiche */
.stats-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Form Evento */
.event-form {
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.event-form.hidden {
    display: none;
}

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

.form-card {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.form-header h2 {
    color: #667eea;
    font-size: 1.3rem;
}

.btn-close {
    background: #ef4444;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: #dc2626;
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.input-field,
.textarea-field {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-field:focus,
.textarea-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.textarea-field {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #374151;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #f3f4f6;
}

.btn-success {
    flex: 2;
    padding: 12px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

/* Eventi Container */
.events-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.loading {
    text-align: center;
    color: #fff;
    padding: 40px;
    font-size: 1.1rem;
}

.event-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.event-title-container {
    flex: 1;
}

.event-order {
    display: inline-block;
    background: #667eea;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.event-title {
    font-size: 1.2rem;
    color: #1f2937;
    margin-bottom: 5px;
    font-weight: 600;
}

.event-date {
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
}

.event-categoria {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Categorie calendario */
.categoria-uscita_capitolo { background: #d1fae5; color: #065f46; }
.categoria-anteprima { background: #e0e7ff; color: #3730a3; }
.categoria-libro_completo { background: #fef3c7; color: #92400e; }
.categoria-aggiornamento { background: #dbeafe; color: #1e40af; }
.categoria-manutenzione { background: #f3e8ff; color: #6b21a8; }
.categoria-musica { background: #fce7f3; color: #9f1239; }
.categoria-cronaca { background: #fef3c7; color: #92400e; }
.categoria-personaggi { background: #ede9fe; color: #5b21b6; }
.categoria-diario_lilith { background: #fee2e2; color: #991b1b; }
.categoria-minigiochi { background: #ddd6fe; color: #5b21b6; }
.categoria-portale_valkora { background: #e0f2fe; color: #075985; }
.categoria-shop { background: #fef3c7; color: #92400e; }
.categoria-evento_live { background: #ede9fe; color: #5b21b6; }
.categoria-anniversario { background: #fce7f3; color: #9f1239; }
.categoria-altro { background: #f1f5f9; color: #475569; }

.event-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 15px;
}

.event-extra {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
    margin-top: 5px;
}

.event-link {
    margin-top: 10px;
    margin-bottom: 10px;
}

.event-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.event-link a:hover {
    text-decoration: underline;
}

/* Badge Priorità */
.priorita-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.priorita-critica { background: #fee2e2; color: #991b1b; }
.priorita-alta { background: #fed7aa; color: #9a3412; }
.priorita-media { background: #fef3c7; color: #92400e; }
.priorita-bassa { background: #d1fae5; color: #065f46; }

/* Tipo Aggiornamento */
.categoria-feature { background: #dbeafe; color: #1e40af; }
.categoria-fix { background: #fef3c7; color: #92400e; }
.categoria-major { background: #ede9fe; color: #5b21b6; }
.categoria-security { background: #fee2e2; color: #991b1b; }
.categoria-ui { background: #fce7f3; color: #9f1239; }

.event-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.event-actions {
    display: flex;
    gap: 10px;
}

.btn-edit,
.btn-delete {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-edit {
    background: #3b82f6;
    color: #fff;
}

.btn-edit:hover {
    background: #2563eb;
}

.btn-delete {
    background: #ef4444;
    color: #fff;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #fff;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1rem;
    opacity: 0.9;
}

/* ========================================
   TABLET (min-width: 480px)
   ======================================== */
@media (min-width: 480px) {
    body {
        font-size: 15px;
    }

    .header h1 {
        font-size: 1.6rem;
    }
    
    .btn-logout {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .toolbar {
        flex-direction: row;
    }

    .btn-primary {
        flex: 1;
    }

    .select-field {
        flex: 1;
    }

    .form-row {
        grid-template-columns: 2fr 1fr;
    }

    .event-title {
        font-size: 1.3rem;
    }
}

/* ========================================
   TABLET LARGE (min-width: 768px)
   ======================================== */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }

    .container {
        max-width: 750px;
    }

    .header {
        padding: 25px 20px;
        margin-bottom: 30px;
    }

    .header h1 {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: row;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .form-card {
        padding: 30px;
    }

    .event-image {
        height: 250px;
    }
}

/* ========================================
   DESKTOP (min-width: 1024px)
   ======================================== */
@media (min-width: 1024px) {
    .container {
        max-width: 1000px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 2.5rem;
    }

    .stats-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .events-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .event-card {
        height: 100%;
    }
}

/* ========================================
   DESKTOP LARGE (min-width: 1400px)
   ======================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .events-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   ANIMATIONS & UTILITIES
   ======================================== */
html {
    scroll-behavior: smooth;
}

.hidden {
    display: none !important;
}

/* Indicatore Sessione */
.session-info {
    display: flex;
    align-items: center;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.session-indicator {
    margin-right: 5px;
    font-size: 10px;
}

.session-text {
    font-weight: 500;
}

/* Checkbox "Ricordami" */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label:hover .checkmark {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Accessibilità */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

