/* ===== GAMES DESIGN SYSTEM ===== */

/* ===== CORREZIONE TITOLI CARD IN MODALITÀ DARK ===== */

/* Correzione titoli h4 nelle game-card di games.php */
[data-theme="dark"] .game-card h4 {
    color: #ffffff !important;
    font-weight: 600;
}

/* Correzione titoli nelle categorie quiz - quiz.php */
[data-theme="dark"] .games-section .card-title,
[data-theme="dark"] .category-card .card-title {
    color: #ffffff !important;
    font-weight: 600;
}

/* Correzione descrizioni nelle game-card */
[data-theme="dark"] .game-card p {
    color: #b3b3b3 !important;
}

/* Correzione titoli categoria nelle mini-card di navigazione */
[data-theme="dark"] .games-navigation-container .fw-semibold,
[data-theme="dark"] .games-navigation-container .text-dark {
    color: #e2e8f0 !important;
}

/* Assicura che tutti i titoli delle card siano visibili */
[data-theme="dark"] .games-section .game-category-card h4,
[data-theme="dark"] .games-section .game-category-card h5 {
    color: #ffffff !important;
}

/* Correzione per i titoli generici nelle sezioni giochi */
[data-theme="dark"] .games-section h4:not(.text-primary),
[data-theme="dark"] .games-container h4:not(.text-primary) {
    color: #ffffff !important;
}

/* ===== CORREZIONI VISIBILITÀ MODALITÀ DAY - GAMES.PHP ===== */

/* 1. Correzione titoli e descrizioni sezione navigazione - SOLO modalità Day */
body:not([data-theme="dark"]) section.py-4.bg-gradient-light h4.text-primary {
    color: #007bff !important; /* Blu invece di bianco */
}

body:not([data-theme="dark"]) section.py-4.bg-gradient-light .text-muted {
    color: #6c757d !important; /* Grigio invece di bianco */
}

/* 2. Assicura visibilità icone e testi nelle mini-card navigazione - modalità Day */
body:not([data-theme="dark"]) .games-navigation-container .game-nav-item .text-dark {
    color: #212529 !important;
}

body:not([data-theme="dark"]) .games-navigation-container .game-nav-item .text-muted {
    color: #6c757d !important;
}

body:not([data-theme="dark"]) .games-navigation-container .game-nav-item .fw-bold {
    color: #212529 !important;
}

/* 3. Correzione descrizioni nelle card dei giochi - modalità Day */
body:not([data-theme="dark"]) .game-card p {
    color: #6c757d !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body:not([data-theme="dark"]) .category-header p {
    color: #6c757d !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 4. Assicura visibilità titoli sezioni giochi - modalità Day */
body:not([data-theme="dark"]) .category-header h3 {
    color: #212529 !important;
}

body:not([data-theme="dark"]) .game-card h4 {
    color: #212529 !important;
}

/* 5. Correzione icone nelle card di navigazione - modalità Day */
body:not([data-theme="dark"]) .game-nav-icon i {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 6. Assicura che tutti gli elementi siano visibili - modalità Day */
body:not([data-theme="dark"]) .games-navigation-container * {
    opacity: 1 !important;
    visibility: visible !important;
}

body:not([data-theme="dark"]) .games-section * {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Games Grid Layout */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Game Cards */
.game-card {
    background: var(--card-bg-color, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-lg, 12px);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.05));
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg, 0 8px 25px rgba(0,0,0,0.15));
    border-color: var(--primary-color, #007bff);
}

.game-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary-color, #333);
}

.game-card p {
    font-size: 0.9rem;
    color: var(--text-secondary-color, #666);
    line-height: 1.4;
}

/* Game Category Cards */
.game-category-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius, 8px);
    box-shadow: var(--shadow-light, 0 2px 8px rgba(0,0,0,0.1));
    transition: all 0.3s ease;
    height: 100%;
    border: 2px solid transparent;
}

.game-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--primary-color, #007bff);
}

.game-icon {
    color: var(--primary-color, #007bff);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.game-category-card:hover .game-icon {
    transform: scale(1.1);
}

/* Games Navigation */
.games-navigation-container {
    background: var(--bg-light-gray, #0f0f0f);
    padding: 2rem;
    border-radius: var(--border-radius-lg, 12px);
    margin-bottom: 2rem;
}

.game-nav-item {
    margin-bottom: 1rem;
}

/* Miglioramento contrasti modalità Day */
.games-navigation-container {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: var(--border-radius-lg, 12px);
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.game-nav-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #ffffff;
    border-radius: var(--border-radius, 8px);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    color: #333;
}

.game-nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-color: #007bff;
    color: #333;
}

/* Sezioni giochi con migliore contrasto */
.games-section {
    background-color: #ffffff;
    padding: 2rem 0;
    margin: 2rem 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.games-container {
    background-color: #ffffff;
    border-radius: var(--border-radius-lg, 12px);
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

/* Card giochi con migliore contrasto */
.game-category-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: var(--border-radius, 8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 2px solid #e9ecef;
}

.game-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.game-nav-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.1));
}

.game-nav-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
    color: white;
}

.game-nav-link:hover .game-nav-icon {
    transform: scale(1.1);
}

/* Games Section */
.games-section {
    background-color: var(--bg-primary, #ffffff);
    padding: 2rem 0;
    margin: 2rem 0;
}

.games-container {
    background-color: var(--card-bg-color, #ffffff);
    border-radius: var(--border-radius-lg, 12px);
    padding: 2rem;
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.05));
    margin-bottom: 2rem;
}

.games-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.game-category {
    background-color: var(--bg-light-gray, #f8f9fa);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-md, 8px);
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.game-category:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.1));
    border-color: var(--primary-color, #007bff);
}

/* Responsive Design */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .games-categories {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .games-container {
        padding: 1rem;
    }
    
    .game-category-card {
        height: 100%;
        min-height: 280px;
    }
    
    .game-category-card .card-body {
        padding: 1rem;
    }
    
    .game-category-card .game-icon {
        margin-bottom: 0.5rem;
    }
    
    .game-category-card .game-icon i {
        font-size: 2rem !important;
    }
    
    .game-category-card h5 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .game-category-card p {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .game-category-card .card-footer {
        padding: 0.75rem;
    }
    
    .game-category-card .btn {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
}

/* Layout ancora più compatto per schermi molto piccoli */
@media (max-width: 480px) {
    .game-category-card {
        min-height: 250px;
    }
    
    .game-category-card .card-body {
        padding: 0.75rem;
    }
    
    .game-category-card .game-icon i {
        font-size: 1.8rem !important;
    }
    
    .game-category-card h5 {
        font-size: 0.9rem;
    }
    
    .game-category-card p {
        font-size: 0.8rem;
    }
}

/* Game Buttons */
.game-btn {
    display: inline-block;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    margin-top: 1rem;
}

.game-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    color: white;
    text-decoration: none;
}

.game-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
}

/* Quiz Button Styles */
.btn.btn-success.btn-lg.rounded-pill,
.btn.btn-danger.btn-lg.rounded-pill {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn.btn-success.btn-lg.rounded-pill:hover,
.btn.btn-danger.btn-lg.rounded-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Game Difficulty Badges */
.game-difficulty {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.difficulty-easy {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.difficulty-medium {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.difficulty-hard {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* Layout verticale per le sezioni dei giochi */
.games-categories-vertical {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

/* Rimozione centramento per sezioni specifiche - RIMOSSO */
/* .game-category-left {
    text-align: left;
}

.game-category-left .category-header {
    text-align: left;
}

.game-category-left .category-header h3,
.game-category-left .category-header p {
    text-align: left;
} */

/* Mantieni centramento per category-header */
.category-header {
    text-align: center;
}

.category-header h3,
.category-header p {
    text-align: center;
}

/* Override per games-categories standard */
.games-categories {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

/* Responsive per layout verticale */
@media (max-width: 768px) {
    .games-categories-vertical {
        gap: 1.5rem;
    }
    
    .game-category {
        margin-bottom: 1rem;
    }
}

/* Game Icons - Forza tutte le icone a fa-3x */
.game-icon i,
.game-category-card .game-icon i,
.section-icon-item i {
    font-size: 3rem !important;
}

/* Responsive - mantieni fa-3x anche su mobile */
@media (max-width: 768px) {
    .game-category-card .game-icon i {
        font-size: 3rem !important;
    }
}

@media (max-width: 480px) {
    .game-category-card .game-icon i {
        font-size: 3rem !important;
    }
}

/* ===== MODIFICHE PER UNIFORMITÀ E MIGLIORAMENTI ===== */

/* 1. Uniformare il colore del menu di navigazione alle card */
body:not([data-theme="dark"]) .games-navigation-container {
    background: #ffffff !important;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.1) !important;
    border: 2px solid #e9ecef !important;
    margin-bottom: 2rem;
}

body:not([data-theme="dark"]) .row.justify-content-center {
    background: #ffffff !important;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    border: 2px solid #e9ecef !important;
    margin: 0 auto;
}

body:not([data-theme="dark"]) .game-nav-item .bg-white {
    background: #ffffff !important;
    border: 2px solid #e9ecef !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

body:not([data-theme="dark"]) .game-nav-item:hover .bg-white {
    background: #f8f9fa !important;
    border-color: #007bff !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
    transform: translateY(-8px) !important;
}

/* 2. Uniformare tutte le icone delle sezioni Game a fa-3x */
.game-icon i,
.game-category-card .game-icon i,
.section-icon-item i,
.game-nav-icon i {
    font-size: 3rem !important;
}

/* Icone del menu di navigazione */
.game-nav-icon {
    width: 80px !important;
    height: 80px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.game-nav-icon i {
    font-size: 3rem !important;
}

/* 3. Centrare il testo dei titoli delle sezioni e dei giochi */
.category-header {
    text-align: center !important;
    margin-bottom: 2rem;
}

.category-header h3 {
    text-align: center !important;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.category-header p {
    text-align: center !important;
    margin-bottom: 0;
}

.game-card h4 {
    text-align: center !important;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.game-card p {
    text-align: center !important;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 4. Migliorare il CSS del pulsante "Gioca Ora" */
.game-btn {
    display: inline-block;
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    color: white !important;
    padding: 0.875rem 2rem !important;
    border-radius: 30px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4) !important;
    margin-top: 1.5rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.game-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.5) !important;
    color: white !important;
    text-decoration: none !important;
}

.game-btn:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4) !important;
}

.game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.game-btn:hover::before {
    left: 100%;
}

/* Responsive - mantieni le modifiche anche su mobile */
@media (max-width: 768px) {
    .game-nav-icon {
        width: 70px !important;
        height: 70px !important;
    }
    
    .game-nav-icon i {
        font-size: 2.5rem !important;
    }
    
    .game-icon i,
    .game-category-card .game-icon i {
        font-size: 2.5rem !important;
    }
    
    .game-btn {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .game-nav-icon {
        width: 60px !important;
        height: 60px !important;
    }
    
    .game-nav-icon i {
        font-size: 2rem !important;
    }
    
    .game-icon i,
    .game-category-card .game-icon i {
        font-size: 2rem !important;
    }
}

/* ===== STILI SPECIFICI MODALITÀ DAY (senza toccare dark mode) ===== */

/* Applica solo quando NON è in modalità dark */
body:not([data-theme="dark"]) main {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding-top: 2rem;
    border-top: 3px solid #007bff;
}

/* Sezione hero con migliore contrasto - solo modalità day */
body:not([data-theme="dark"]) .py-5.bg-light {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-bottom: 2px solid #dee2e6;
    box-shadow: 0 2px solid #dee2e6;
}

/* Navigazione giochi con migliore contrasto - solo modalità day */
body:not([data-theme="dark"]) .games-navigation-container {
    background: #ffffff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
    margin-bottom: 2rem;
}

body:not([data-theme="dark"]) .game-nav-link {
    background: #ffffff;
    border: 2px solid #e9ecef !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

body:not([data-theme="dark"]) .game-nav-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: #007bff !important;
}

/* Sezioni giochi con migliore contrasto - solo modalità day */
body:not([data-theme="dark"]) .games-section {
    background: #ffffff;
    padding: 3rem 0;
    margin: 3rem 0;
    border-top: 2px solid #dee2e6;
    border-bottom: 2px solid #dee2e6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

body:not([data-theme="dark"]) .games-container {
    background: #ffffff;
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 6px 25px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    border: 2px solid #e9ecef;
}

/* Card giochi con migliore contrasto - solo modalità day */
body:not([data-theme="dark"]) .game-category-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 2px solid #e9ecef;
}

body:not([data-theme="dark"]) .game-category-card:hover {
    background: #f8f9fa !important;
    border-color: #007bff !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transform: translateY(-8px) !important;
}

/* Sezioni con sfondo più contrastato - solo day mode */
body:not([data-theme="dark"]) .games-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-top: 3px solid #dee2e6 !important;
    border-bottom: 3px solid #dee2e6 !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08) !important;
}

body:not([data-theme="dark"]) .games-container {
    background: #ffffff !important;
    border: 2px solid #e9ecef !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
}

/* ===== CORREZIONI SPECIFICHE PER QUIZ.PHP IN MODALITÀ DARK ===== */

/* Sezione Hero - py-5.bg-light in quiz.php */
[data-theme="dark"] section.py-5.bg-light {
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%) !important;
    border-bottom: 2px solid #4a5568 !important;
    box-shadow: 0 2px solid #4a5568 !important;
}

[data-theme="dark"] section.py-5.bg-light .container {
    background: transparent !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] section.py-5.bg-light .container.text-center {
    background: transparent !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] section.py-5.bg-light .row.justify-content-center {
    background: transparent !important;
}

/* Icone delle sezioni nella hero */
[data-theme="dark"] .section-icon-item .bg-white {
    background-color: #2d3748 !important;
    border: 1px solid #4a5568 !important;
}

[data-theme="dark"] .section-icon-item .text-dark {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .section-icon-item:hover .bg-white {
    background-color: #374151 !important;
    border-color: #667eea !important;
}

/* Sezione Quiz Speciali - bg-light */
[data-theme="dark"] section#quiz-speciali.py-5.bg-light {
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%) !important;
    border-top: 2px solid #4a5568 !important;
    border-bottom: 2px solid #4a5568 !important;
}

[data-theme="dark"] section#quiz-speciali .container {
    background: transparent !important;
}

[data-theme="dark"] section#quiz-speciali .card {
    background-color: #2d3748 !important;
    border: 1px solid #4a5568 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] section#quiz-speciali .card-title {
    color: #ffffff !important;
}

[data-theme="dark"] section#quiz-speciali .card-text {
    color: #b3b3b3 !important;
}

[data-theme="dark"] section#quiz-speciali .text-muted {
    color: #a0aec0 !important;
}

/* Sezione Categorie Quiz - games-section */
[data-theme="dark"] section.games-section {
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%) !important;
    border-top: 3px solid #4a5568 !important;
    border-bottom: 3px solid #4a5568 !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .games-section .games-container {
    background: #2d2d2d !important;
    border: 2px solid #4a5568 !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3) !important;
    border-radius: 15px !important;
    padding: 20px !important;
}

[data-theme="dark"] .games-section .game-category {
    background: #2d2d2d !important;
    border: 1px solid #4a5568 !important;
}

[data-theme="dark"] .games-section .category-header h3 {
    color: #ffffff !important;
}

[data-theme="dark"] .games-section .category-header p {
    color: #b3b3b3 !important;
}

[data-theme="dark"] .games-section .category-header i {
    color: #ffffff !important;
}

/* Footer - Form contatti */
[data-theme="dark"] footer.bg-dark {
    background: #1a1a1a !important;
    border-top: 2px solid #4a5568 !important;
}

[data-theme="dark"] footer .form-control {
    background-color: #2d3748 !important;
    border: 1px solid #4a5568 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] footer .form-control:focus {
    background-color: #2d3748 !important;
    border-color: #667eea !important;
    color: #e2e8f0 !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

[data-theme="dark"] footer .form-control::placeholder {
    color: #a0aec0 !important;
}

[data-theme="dark"] footer .form-label {
    color: #e2e8f0 !important;
}

[data-theme="dark"] footer h4 {
    color: #ffffff !important;
}

/* Correzioni generali per contenitori bianchi */
[data-theme="dark"] .bg-light {
    background: #2d2d2d !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .bg-white {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .text-center {
    color: #e2e8f0 !important;
}

/* Contenitori generici */
[data-theme="dark"] .container {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .row {
    color: #e2e8f0 !important;
}

/* ===== REGOLE AGGRESSIVE PER ELIMINARE SPAZI BIANCHI ===== */

/* Rimuovi tutti i margini e padding dalle sezioni principali */
section.py-5.bg-light,
section.py-4.bg-gradient-light.border-bottom,
section.games-section,
section#quiz-speciali.py-5.bg-light {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0.5rem 0 !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Rimuovi spazi dal main e body */
main {
    margin: 0 !important;
    padding: 0 !important;
}

body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Rimuovi spazi dai container */
.container,
.container-fluid {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Regole specifiche per quiz.php */
body.quiz-page section.py-5.bg-light,
body.quiz-page section#quiz-speciali.py-5.bg-light,
body.quiz-page section.games-section {
    margin: 0 !important;
    padding: 0.5rem 0 !important;
}

/* Modalità scura - regole aggressive */
[data-theme="dark"] section.py-5.bg-light,
[data-theme="dark"] section.py-4.bg-gradient-light.border-bottom,
[data-theme="dark"] section.games-section,
[data-theme="dark"] section#quiz-speciali.py-5.bg-light {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0.5rem 0 !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    border-top: none !important;
    border-bottom: none !important;
}

/* Regola universale per sovrascrivere Bootstrap */
* {
    box-sizing: border-box !important;
}

/* Rimuovi spazi specifici di Bootstrap - ESCLUDI HEADER */
.py-5:not(header) {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.py-4:not(header) {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Footer senza margine superiore */
footer {
    margin-top: 0 !important;
    padding-top: 1rem !important;
}

/* Rimuovi margini dai container interni */
.games-navigation-container {
    margin-bottom: 0 !important;
}

.games-container {
    margin-bottom: 0 !important;
}

/* Modalità Day - rimuovi margini aggiuntivi */
body:not([data-theme="dark"]) .games-section {
    margin: 0 !important;
    padding: 0.5rem 0 !important;
}

body:not([data-theme="dark"]) .games-container {
    margin-bottom: 0 !important;
}

body:not([data-theme="dark"]) .games-navigation-container {
    margin-bottom: 0 !important;
}

/* Modalità Dark - rimuovi margini aggiuntivi */
[data-theme="dark"] .games-section .games-container {
    margin-bottom: 0 !important;
}

[data-theme="dark"] footer.bg-dark {
    margin-top: 0 !important;
    padding-top: 1rem !important;
}

/* Rimuovi bordi che creano spazi visivi */
.border-bottom {
    border-bottom: none !important;
}

section.py-4.bg-gradient-light {
    border-bottom: none !important;
}

/* Assicurati che non ci siano gap tra le sezioni */
body {
    line-height: 1;
}

section + section {
    margin-top: 0 !important;
}

section + main {
    margin-top: 0 !important;
}

main + footer {
    margin-top: 0 !important;
}

/* Correzioni per il menu di navigazione in modalità scura */
[data-theme="dark"] section.py-4.bg-gradient-light .row.justify-content-center {
    background: transparent !important;
}

/* Correzione mirata per i contenitori in modalità scura - preserva le card */
[data-theme="dark"] section.py-4.bg-gradient-light {
    background: #1a202c !important;
}

[data-theme="dark"] section.py-4.bg-gradient-light .col-12 {
    background: transparent !important;
}

[data-theme="dark"] section.py-4.bg-gradient-light .games-navigation-container {
    background: transparent !important;
    border: none !important;
}

/* Mantieni le card di navigazione con il loro stile scuro */
[data-theme="dark"] .games-navigation-container .game-nav-item .bg-white {
    background-color: #2d3748 !important;
    border-color: #4a5568 !important;
}

[data-theme="dark"] .games-navigation-container .game-nav-item .text-dark {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .games-navigation-container .game-nav-item .text-muted {
    color: #a0aec0 !important;
}

[data-theme="dark"] .games-navigation-container .game-nav-item:hover .bg-white {
    background-color: #4a5568 !important;
}

/* Rimuovere la linea blu e cambiare il testo a bianco */
section.py-4.bg-gradient-light.border-bottom {
    border-bottom: none !important;
}

section.py-4.bg-gradient-light h4.text-primary {
    color: white !important;
}

section.py-4.bg-gradient-light .text-muted {
    color: white !important;
}
/* Correzione specifica per i titoli fw-bold nelle mini-card di navigazione */
[data-theme="dark"] .games-navigation-container .fw-bold {
    color: #e2e8f0 !important;
}

/* Correzione per span con fw-bold e text-dark */
[data-theme="dark"] .games-navigation-container span.fw-bold.text-dark {
    color: #e2e8f0 !important;
}

/* Assicura che tutti i titoli nelle mini-card siano visibili */
[data-theme="dark"] .games-navigation-container .game-nav-item span.fw-bold {
    color: #e2e8f0 !important;
}
/* ===== CORREZIONE TITOLI MINI-CARD NAVIGAZIONE - MODALITÀ DARK ===== */

/* Correzione specifica per i titoli fw-bold nelle mini-card di navigazione */
[data-theme="dark"] .games-navigation-container .fw-bold {
    color: #e2e8f0 !important;
}

/* Correzione per span con fw-bold e text-dark */
[data-theme="dark"] .games-navigation-container span.fw-bold.text-dark {
    color: #e2e8f0 !important;
}

/* Assicura che tutti i titoli nelle mini-card siano visibili */
[data-theme="dark"] .games-navigation-container .game-nav-item span.fw-bold {
    color: #e2e8f0 !important;
}

/* Correzione per le descrizioni small nelle mini-card */
[data-theme="dark"] .games-navigation-container small.text-muted {
    color: #a0aec0 !important;
}

/* ===== REGOLE SPECIFICHE SOLO PER QUIZ.PHP ===== */

/* Regole specifiche SOLO per quiz.php - usando selettori mirati */

/* Rimozione spazi bianchi SOLO in quiz.php */
.quiz-app section.py-5.bg-light,
.quiz-app section.games-section,
.quiz-app section#quiz-speciali.py-5.bg-light,
.quiz-app main,
body:has(.quiz-app) section.py-5.bg-light {
    margin: 0 !important;
    padding: 0.5rem 0 !important;
    border: none !important;
}

/* Rimozione padding specifico per quiz-app */
.quiz-app {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.quiz-app .quiz-header-bar {
    padding: 0.5rem 0 !important;
    margin-bottom: 0 !important;
}

.quiz-app #question-container {
    padding: 1rem !important;
    margin-bottom: 0 !important;
}

/* Modalità scura - SOLO per quiz.php */
[data-theme="dark"] .quiz-app section.py-5.bg-light,
[data-theme="dark"] .quiz-app section#quiz-speciali.py-5.bg-light {
    background-color: var(--bs-dark) !important;
    border-top: none !important;
    border-bottom: none !important;
}

[data-theme="dark"] body:has(.quiz-app) section.py-5.bg-light {
    background-color: var(--bs-dark) !important;
}

/* ===== FIX CENTRATURA MINI-CARD NAVIGAZIONE IN GAMES.PHP ===== */

/* Assicura che il contenitore delle mini-card sia sempre centrato */
body:not([data-theme="dark"]) .row.justify-content-center {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

/* Responsive per mobile - migliora la centratura */
@media (max-width: 768px) {
    body:not([data-theme="dark"]) .row.justify-content-center {
        padding: 1rem !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    /* Assicura che le mini-card siano centrate nel contenitore */
    .section-icons-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 15px !important;
        width: 100% !important;
    }
}

@media (max-width: 576px) {
    body:not([data-theme="dark"]) .row.justify-content-center {
        padding: 0.5rem !important;
    }
    
    .section-icons-container {
        gap: 10px !important;
        justify-content: center !important;
    }
    
    /* Forza la centratura anche per gli elementi individuali */
    .section-icon-item {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}

/* Modalità scura - applica le stesse correzioni */
[data-theme="dark"] .row.justify-content-center {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    [data-theme="dark"] .row.justify-content-center {
        padding: 1rem !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
}

/* Correzione layout mini-card navigazione categorie - solo per games-navigation-container */
.games-navigation-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 1rem !important;
    justify-content: center !important;
    align-items: stretch !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

.games-navigation-container .game-nav-item {
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
}

.games-navigation-container .game-nav-item .bg-white {
    width: 100% !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    transition: all 0.3s ease !important;
    padding: 1rem !important; /* Ridotto da 0.75rem */
}

.games-navigation-container .game-nav-item .bg-white:hover {
    border-color: rgba(255, 255, 255, 1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Ingrandimento icone e testi */
.games-navigation-container .game-nav-icon {
    padding: 0.75rem !important; /* Ridotto da 1rem */
    width: 3.5rem !important; /* Aumentato da 2.5rem */
    height: 3.5rem !important; /* Aumentato da 2.5rem */
    margin-bottom: 0.5rem !important;
}

.games-navigation-container .game-nav-icon i {
    font-size: 1.5rem !important; /* Aumentato da 1rem */
}

.games-navigation-container .fw-bold {
    font-size: 1rem !important; /* Aumentato da 0.85rem */
    margin-bottom: 0.25rem !important;
}

.games-navigation-container small {
    font-size: 0.875rem !important; /* Aumentato da 0.7rem */
    line-height: 1.2 !important;
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .games-navigation-container {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem !important;
        padding: 0 0.5rem !important;
    }
    
    .games-navigation-container .game-nav-item .bg-white {
        padding: 0.75rem !important; /* Ridotto ma non troppo */
    }
    
    .games-navigation-container .game-nav-icon {
        padding: 0.5rem !important;
        width: 3rem !important; /* Mantenuto grande */
        height: 3rem !important;
    }
    
    .games-navigation-container .game-nav-icon i {
        font-size: 1.25rem !important; /* Mantenuto leggibile */
    }
    
    .games-navigation-container .fw-bold {
        font-size: 0.9rem !important; /* Leggibile su mobile */
    }
    
    .games-navigation-container small {
        font-size: 0.8rem !important; /* Leggibile su mobile */
    }
}

@media (max-width: 576px) {
    .games-navigation-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .games-navigation-container .game-nav-item .bg-white {
        padding: 0.6rem !important;
    }
    
    .games-navigation-container .game-nav-icon {
        width: 2.75rem !important;
        height: 2.75rem !important;
    }
    
    .games-navigation-container .game-nav-icon i {
        font-size: 1.1rem !important;
    }
}

/* Modalità scura */
body[data-theme="dark"] .games-navigation-container .game-nav-item .bg-white {
    background-color: var(--bs-dark) !important;
    border-color: rgba(108, 117, 125, 0.5) !important;
}

body[data-theme="dark"] .games-navigation-container .game-nav-item .bg-white:hover {
    border-color: rgba(108, 117, 125, 0.8) !important;
}
