/**
 * Label the Image Activity Styles
 * Vocabulary quiz with image and word choices
 */

/* ===== Header Layout ===== */
.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
}

/* ===== Language Flag ===== */
.language-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: var(--bg-cream);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
    overflow: hidden;
}

.language-flag-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ===== Score Badge ===== */
.header-score {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
}

/* ===== Start Overlay ===== */
.start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(250, 251, 252, 0.98) 0%, rgba(245, 247, 250, 0.98) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    padding: 1rem;
}

.start-overlay.hidden {
    display: none;
}

.start-content {
    text-align: center;
    padding: 1.25rem 1.5rem;
    background: var(--bg-section);
    border-radius: var(--radius-large);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 340px;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.start-icon {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.start-title {
    font-family: 'Baloo 2', cursive;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.start-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.start-btn {
    font-size: 1rem;
    padding: 0.75rem 2rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Main Content Wrapper (Side-by-Side Layout) ===== */
.main-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .main-content-wrapper {
        flex-direction: row;
        align-items: stretch;
    }

    .image-section {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .choices-section {
        flex: 0 0 320px;
        display: flex;
        flex-direction: column;
    }
}

@media (min-width: 992px) {
    .choices-section {
        flex: 0 0 380px;
    }
}

@media (min-width: 1200px) {
    .choices-section {
        flex: 0 0 420px;
    }
}

/* ===== Image Section ===== */
.image-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ===== Image Container ===== */
.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    min-height: 180px;
    background: var(--bg-section);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-soft);
    flex: 1;
}

.activity-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-medium);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    object-fit: contain;
    animation: imageEnter 0.35s ease-out;
}

@keyframes imageEnter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Success Message ===== */
.success-message {
    background: linear-gradient(145deg, var(--correct-green) 0%, #6BC5C5 100%);
    border-radius: var(--radius-large);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-soft);
    animation: successSlideIn 0.4s ease-out;
}

.success-message.hidden {
    display: none;
}

.success-message-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.success-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.success-words {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Baloo 2', cursive;
}

.english-word {
    font-size: 1.1rem;
    font-weight: 600;
}

.equals-sign {
    font-size: 1rem;
    opacity: 0.8;
}

.foreign-word {
    font-size: 1.2rem;
    font-weight: 700;
}

.phonetic-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.9;
}

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

/* ===== Choices Section ===== */
.choices-section {
    display: flex;
    flex-direction: column;
}

/* ===== Choices Container ===== */
.choices-container {
    padding: 1rem;
    background: var(--bg-section);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-soft);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.zone-label .badge {
    font-family: 'Baloo 2', cursive;
    font-size: 0.9rem;
    font-weight: 600;
    background: linear-gradient(145deg, var(--primary-purple) 0%, var(--primary-pink) 100%);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-round);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

/* ===== Choices Grid ===== */
.choices-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
    flex: 1;
}

@media (min-width: 576px) {
    .choices-grid {
        gap: 0.85rem;
    }
}

/* ===== Choice Button ===== */
.choice-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 0.75rem;
    min-height: 70px;
    background: linear-gradient(145deg, var(--primary-blue) 0%, var(--primary-teal) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-medium);
    font-family: 'Baloo 2', cursive;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15), 0 4px 12px rgba(91, 155, 213, 0.2);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
}

.choice-btn:hover:not(.correct):not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15), 0 8px 20px rgba(91, 155, 213, 0.25);
}

.choice-btn:active:not(.correct):not(.disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

/* ===== Choice Text ===== */
.choice-text {
    display: block;
    line-height: 1.3;
}

/* ===== Choice Phonetic ===== */
.choice-phonetic {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    font-style: italic;
    opacity: 0.9;
    margin-top: 0.2rem;
}

/* ===== Choice Audio Button ===== */
.choice-audio-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.choice-audio-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* ===== Correct State ===== */
.choice-btn.correct {
    background: linear-gradient(145deg, var(--correct-green) 0%, #6BC5C5 100%);
    pointer-events: none;
    animation: correctPop 0.4s ease-out;
}

@keyframes correctPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* ===== Incorrect State ===== */
.choice-btn.incorrect {
    background: var(--incorrect-red);
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ===== Disabled State ===== */
.choice-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ===== Navigation ===== */
.navigation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.nav-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: linear-gradient(145deg, var(--primary-blue) 0%, var(--primary-teal) 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15), 0 4px 12px rgba(91, 155, 213, 0.2);
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.15), 0 8px 20px rgba(91, 155, 213, 0.25);
}

.nav-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #ccc;
    box-shadow: none;
}

.card-counter {
    font-family: 'Baloo 2', cursive;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-purple);
    min-width: 90px;
    background: var(--bg-section);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-round);
    box-shadow: var(--shadow-soft);
}

/* ===== Swipe Hint ===== */
.swipe-hint {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== Progress Container ===== */
.progress-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
}

/* ===== Responsive Styles ===== */

/* Tablets */
@media (min-width: 768px) {
    .image-container {
        padding: 2rem;
        min-height: 220px;
    }

    .activity-image {
        max-height: 260px;
    }

    .choice-btn {
        padding: 1rem;
        min-height: 80px;
        font-size: 1.2rem;
    }

    .choice-phonetic {
        font-size: 0.85rem;
    }

    .nav-btn {
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
    }

    .card-counter {
        font-size: 1.4rem;
        padding: 0.5rem 1rem;
    }
}

/* Desktops */
@media (min-width: 992px) {
    .image-container {
        padding: 2.5rem;
        min-height: 280px;
    }

    .activity-image {
        max-height: 300px;
    }

    .choice-btn {
        padding: 1.2rem;
        min-height: 90px;
        font-size: 1.3rem;
    }

    .choice-phonetic {
        font-size: 0.9rem;
    }

    .nav-btn {
        width: 60px;
        height: 60px;
        font-size: 1.3rem;
    }

    .card-counter {
        font-size: 1.5rem;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .activity-image {
        max-height: 340px;
    }

    .choice-btn {
        font-size: 1.4rem;
    }
}

/* Small phones */
@media (max-width: 400px) {
    .image-container {
        padding: 1rem;
        min-height: 150px;
    }

    .activity-image {
        max-height: 160px;
    }

    .choices-grid {
        gap: 0.5rem;
    }

    .choice-btn {
        padding: 0.7rem 0.5rem;
        min-height: 60px;
        font-size: 0.95rem;
    }

    .choice-phonetic {
        font-size: 0.7rem;
    }

    .choice-audio-btn {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .card-counter {
        font-size: 1.1rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ===== Fullscreen Mode ===== */
:fullscreen .image-container {
    min-height: 35vh;
}

:fullscreen .activity-image {
    max-height: 35vh;
}

:fullscreen .choices-grid {
    max-width: 800px;
    margin: 0 auto;
}

:fullscreen .choice-btn {
    font-size: 1.3rem;
    padding: 1.2rem;
}

/* ===== Completion Modal ===== */
.completion-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto;
}

.completion-icon.success {
    background: linear-gradient(145deg, var(--correct-green) 0%, #6BC5C5 100%);
    color: white;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15), 0 6px 20px rgba(124, 185, 124, 0.3);
    animation: trophyBounce 0.6s ease-out;
}

@keyframes trophyBounce {
    0% { transform: scale(0) rotate(-20deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    70% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0); }
}

.completion-message {
    font-family: 'Baloo 2', cursive;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .choice-btn,
    .nav-btn {
        transition: none;
    }

    @keyframes shake {
        from, to { transform: none; }
    }

    @keyframes correctPop {
        from, to { transform: none; }
    }

    @keyframes imageEnter {
        from, to { opacity: 1; transform: none; }
    }

    @keyframes trophyBounce {
        from, to { transform: none; }
    }

    @keyframes fadeInOut {
        from, to { opacity: 0.7; }
    }
}
