/* coordinate.css - Stili specifici per Quiz Coordinate */

/* Display coordinata */
.coordinate-display {
    text-align: center;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.coordinate-display h2 {
    font-size: 1.5em;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.instruction-text {
    font-size: 1em;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.target-coordinate {
    font-size: 3em;
    font-weight: 900;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Scacchiera - COMPLETAMENTE RESPONSIVE */
.board-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.chessboard-container {
    position: relative;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 520px; /* Limita la dimensione massima */
}

.chessboard {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
    width: 100%;
    aspect-ratio: 1 / 1; /* Mantiene proporzioni quadrate */
    border: 3px solid #333;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.square {
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.square.light {
    background-color: #f0d9b5;
}

.square.dark {
    background-color: #b58863;
}

.square:hover {
    transform: scale(0.95);
    box-shadow: inset 0 0 0 3px rgba(52, 152, 219, 0.5);
}

/* Feedback visivo */
.square.correct {
    background-color: #27ae60 !important;
    animation: correctPulse 0.6s ease;
}

.square.wrong {
    background-color: #e74c3c !important;
    animation: wrongShake 0.6s ease;
}

.square.highlight {
    box-shadow: inset 0 0 0 4px #f39c12;
    background-color: rgba(243, 156, 18, 0.3) !important;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Etichette coordinate - NASCOSTE per aumentare difficoltà */
.coordinates-labels {
    display: none;
}

/* Pezzi sulla scacchiera - RESPONSIVE E CENTRATI */
.piece {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    pointer-events: none;
    z-index: 1;
    line-height: 1;
    text-align: center;
}

/* Review items */
.review-item {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 60px;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.review-item.correct {
    border-left: 4px solid var(--success-color);
}

.review-item.wrong {
    border-left: 4px solid var(--danger-color);
}

.review-clicked {
    font-weight: 500;
}

.review-time {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Indicatore click disabilitato */
.chessboard.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* Mobile specific */
@media (max-width: 600px) {
    .coordinate-display {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .coordinate-display h2 {
        font-size: 1.3em;
    }
    
    .instruction-text {
        font-size: 0.9em;
        margin-bottom: 10px;
    }
    
    .target-coordinate {
        font-size: 2.5em;
        letter-spacing: 3px;
    }
    
    .chessboard-container {
        padding: 10px;
    }
    
    .piece {
        font-size: calc(6vw);
    }
    
    .review-item {
        grid-template-columns: 30px 1fr 1fr 50px;
        gap: 5px;
        padding: 10px;
        font-size: 0.85em;
    }
}

/* Schermi molto piccoli */
@media (max-width: 380px) {
    .target-coordinate {
        font-size: 2em;
        letter-spacing: 2px;
    }
    
    .chessboard-container {
        padding: 8px;
    }
    
    .piece {
        font-size: calc(5.5vw);
    }
}

/* Schermi grandi */
@media (min-width: 768px) {
    .coordinate-display h2 {
        font-size: 2em;
    }
    
    .target-coordinate {
        font-size: 4em;
        letter-spacing: 8px;
    }
    
    .chessboard-container {
        padding: 20px;
    }
    
    .piece {
        font-size: 2.8em;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .square.light {
        background-color: #f0d9b5;
    }
    
    .square.dark {
        background-color: #b58863;
    }
    
    .chessboard {
        border-color: #555;
    }
    
    .review-item {
        background-color: #2a2a2a;
    }
}