/* Main Styles for Names of Allah Game */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --accent-color: #FF9800;
    --text-color: #333;
    --light-text: #fff;
    --background-color: #f5f5f5;
    --card-bg: #fff;
    --correct-color: #4CAF50;
    --incorrect-color: #F44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background: url('../assets/images/mosque-background.jpg') no-repeat center center fixed,
                #E3F2FD; /* Fallback color */
    background-size: cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 800px;
    padding: 30px;
    text-align: center;
}

.game-header h1 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 2.2rem;
}

.instruction {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 30px;
    line-height: 1.5;
}

#vo-indicator {
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #FFF;
    border-radius: 15px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 15px;
    animation: pulse 1s infinite;
}

.vo-icon {
    animation: wave 0.6s infinite;
    display: inline-block;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

@keyframes wave {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.game-area {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 30px;
}

.names-container, .meanings-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.name-card, .meaning-card {
    background-color: var(--card-bg);
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    padding: 15px 25px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.name-card {
    background-color: #1E88E5; /* Bright blue */
    color: var(--light-text);
    border-color: #0D47A1; /* Darker blue border */
}

.meaning-card {
    background-color: #43A047; /* Bright green */
    color: var(--light-text);
    border-color: #2E7D32; /* Darker green border */
}

.name-card:hover, .name-card.dragging {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.meaning-card.drag-over {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

.meaning-card.matched {
    background-color: #9C27B0; /* Purple for matched pairs */
    border-color: #6A1B9A; /* Dark purple border */
    color: #FFF;
    box-shadow: 0 0 15px rgba(156, 39, 176, 0.6); /* Glow effect */
}

.name-card.matched {
    background-color: #9C27B0; /* Purple for matched pairs */
    border-color: #6A1B9A; /* Dark purple border */
    color: #FFF;
    box-shadow: 0 0 15px rgba(156, 39, 176, 0.6); /* Glow effect */
}

.feedback-container {
    min-height: 60px;
    margin-top: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#feedback-message {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

#character-container {
    width: 150px;
    height: 150px;
    transition: all 0.5s ease;
    margin-top: 10px;
}

.cartoon-character {
    width: 100%;
    height: 100%;
}

.correct-feedback {
    color: var(--correct-color);
}

.incorrect-feedback {
    color: var(--incorrect-color);
}

.completion-message {
    padding: 20px;
    background-color: rgba(76, 175, 80, 0.1);
    border: 2px solid var(--correct-color);
    border-radius: 10px;
}

.completion-message h2 {
    color: var(--correct-color);
    margin-bottom: 10px;
}

.audio-play-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--light-text);
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    z-index: 100;
    transition: all 0.3s ease;
}

.audio-play-button:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

.hidden {
    display: none;
}

/* Preloader styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--secondary-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: bold;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (min-width: 768px) {
    .game-area {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .names-container, .meanings-container {
        flex-direction: column;
        width: 45%;
    }
}
