/**
 * Bingo Activity Styles
 * Teacher caller view and student bingo card
 */

/* ===== 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;
}

/* ===== 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; }
}

/* ===== View Containers ===== */
.view-container {
    animation: fadeIn 0.3s ease;
}

/* ===== Caller Card (Teacher View) ===== */
.caller-card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.caller-card {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 100%);
    border-radius: var(--radius-large);
    padding: 2.5rem;
    min-width: 350px;
    max-width: 550px;
    width: 100%;
    text-align: center;
    color: white;
    box-shadow: var(--shadow-card), 0 8px 30px rgba(91, 155, 213, 0.3);
    position: relative;
}

.caller-card-image {
    margin-bottom: 1.5rem;
}

.caller-card-image img {
    max-width: 180px;
    max-height: 180px;
    border-radius: var(--radius-medium);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background: white;
    padding: 0.5rem;
}

.caller-card-word {
    font-family: 'Baloo 2', cursive;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.caller-card-phonetic {
    font-family: 'Nunito', sans-serif;
    font-size: 1.4rem;
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.caller-card-translation {
    font-family: 'Nunito', sans-serif;
    font-size: 1.4rem;
    opacity: 0.85;
    border-top: 2px solid rgba(255,255,255,0.3);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.caller-audio {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.3rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.caller-audio:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* Caller Navigation */
.caller-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.caller-counter {
    font-family: 'Baloo 2', cursive;
    font-size: 1.4rem;
    color: var(--text-dark);
    min-width: 80px;
    text-align: center;
}

/* Called Items List */
.called-items-container {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--bg-section);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-soft);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.called-items-container h4 {
    font-family: 'Baloo 2', cursive;
    color: var(--primary-purple);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.called-items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.called-item-badge {
    background: var(--bg-cream);
    border: 2px solid #e0e0e0;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-round);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.called-item-badge.current {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    transform: scale(1.05);
}

.called-item-badge .called-item-flag {
    width: 18px;
    height: 13px;
    border-radius: 2px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ===== Student Bingo Card ===== */
.bingo-card-container {
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.bingo-card {
    display: grid;
    gap: 8px;
    background: var(--bg-section);
    padding: 12px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
}

.bingo-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 330px;
}

.bingo-grid-4 {
    grid-template-columns: repeat(4, 1fr);
    max-width: 440px;
}

.bingo-grid-5 {
    grid-template-columns: repeat(5, 1fr);
    max-width: 550px;
}

.bingo-cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 3px solid #dee2e6;
    border-radius: var(--radius-small);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
    min-width: 70px;
    min-height: 70px;
}

.bingo-cell:hover:not(.marked):not(.free-space) {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: var(--primary-blue);
    transform: scale(1.03);
}

.bingo-cell.marked {
    background: linear-gradient(135deg, var(--correct-green) 0%, #66bb6a 100%);
    border-color: var(--correct-green);
    color: white;
}

.bingo-cell.marked::after {
    content: '\2713';
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.25;
    font-weight: bold;
}

.bingo-cell.free-space {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%);
    border-color: var(--primary-orange);
    cursor: default;
}

.bingo-cell .cell-image {
    max-width: 55%;
    max-height: 55%;
    object-fit: contain;
    border-radius: 4px;
}

.bingo-cell .cell-text {
    font-family: 'Baloo 2', cursive;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    word-break: break-word;
    line-height: 1.1;
}

.bingo-cell .cell-text-small {
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    margin-top: 2px;
}

.bingo-cell .free-text {
    font-family: 'Baloo 2', cursive;
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Multilingual cell with flag */
.bingo-cell.multilingual-cell {
    flex-direction: column;
    gap: 2px;
}

.bingo-cell .cell-flag {
    width: 28px;
    height: 20px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Text row with small flag */
.bingo-cell .cell-text-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.bingo-cell .cell-flag-small {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.bingo-cell.multilingual-cell .cell-image {
    max-width: 50%;
    max-height: 45%;
}

.bingo-cell.multilingual-cell .cell-text {
    font-size: 0.75rem;
    line-height: 1.1;
}

@media (max-width: 480px) {
    .bingo-cell .cell-flag {
        width: 22px;
        height: 16px;
    }

    .bingo-cell .cell-flag-small {
        width: 12px;
        height: 9px;
    }

    .bingo-cell.multilingual-cell .cell-text {
        font-size: 0.6rem;
    }

    .bingo-cell.multilingual-cell .cell-image {
        max-width: 45%;
        max-height: 40%;
    }
}

/* Bingo Button */
.bingo-button-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-bingo {
    background: linear-gradient(135deg, var(--primary-orange) 0%, #e65100 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-round);
    font-family: 'Baloo 2', cursive;
    font-size: 1.8rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 6px 20px rgba(230, 81, 0, 0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-bingo:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 rgba(0,0,0,0.15), 0 9px 25px rgba(230, 81, 0, 0.4);
}

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

.btn-bingo:disabled {
    background: #bdbdbd;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-bingo:not(:disabled) {
    animation: pulse-bingo 1.5s ease-in-out infinite;
}

@keyframes pulse-bingo {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ===== Celebration Overlay ===== */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.celebration-content {
    text-align: center;
    color: white;
    padding: 2rem;
}

.celebration-icon {
    font-size: 5rem;
    color: var(--primary-yellow);
    animation: bounceIn 0.6s ease;
    text-shadow: 0 4px 20px rgba(249, 213, 110, 0.5);
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.celebration-title {
    font-family: 'Baloo 2', cursive;
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-yellow);
    text-shadow: 0 4px 20px rgba(249, 213, 110, 0.5);
    margin: 1rem 0;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.celebration-text {
    font-family: 'Nunito', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* ===== Responsive Styles ===== */
@media (max-width: 768px) {
    .caller-card {
        min-width: 280px;
        padding: 1.5rem;
    }

    .caller-card-word {
        font-size: 2.5rem;
    }

    .caller-card-phonetic,
    .caller-card-translation {
        font-size: 1.1rem;
    }

    .caller-card-image img {
        max-width: 120px;
        max-height: 120px;
    }

    .bingo-grid-3 {
        max-width: 280px;
    }

    .bingo-grid-4 {
        max-width: 340px;
    }

    .bingo-grid-5 {
        max-width: 380px;
    }

    .bingo-cell {
        min-width: 55px;
        min-height: 55px;
    }

    .bingo-cell .cell-text {
        font-size: 0.8rem;
    }

    .bingo-cell .cell-text-small {
        font-size: 0.6rem;
    }

    .btn-bingo {
        font-size: 1.4rem;
        padding: 0.8rem 2rem;
    }

    .celebration-title {
        font-size: 3rem;
    }

    .celebration-icon {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    .bingo-card {
        gap: 5px;
        padding: 8px;
    }

    .bingo-cell {
        min-width: 45px;
        min-height: 45px;
        padding: 0.25rem;
    }

    .bingo-cell .cell-text {
        font-size: 0.7rem;
    }

    .bingo-cell .free-text {
        font-size: 0.85rem;
    }

    .caller-navigation {
        gap: 1rem;
    }

    .called-items-container {
        padding: 1rem;
    }
}

/* ===== Print Styles (for teacher reference) ===== */
@media print {
    .activity-header,
    .caller-navigation,
    .bingo-button-container,
    .controls-container {
        display: none !important;
    }
}

/* ===== Multilingual Mode Styles ===== */

/* Multilingual caller card - shows flag above word */
.caller-card.multilingual-caller {
    padding-bottom: 1.5rem;
}

/* Flag container on caller card */
.caller-flag-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.caller-card-flag {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 3px solid rgba(255, 255, 255, 0.4);
}

/* Responsive adjustments for multilingual flag */
@media (min-width: 768px) {
    .caller-card-flag {
        width: 100px;
        height: 75px;
    }
}

@media (max-width: 480px) {
    .caller-card-flag {
        width: 64px;
        height: 48px;
    }

    .caller-card.multilingual-caller .caller-card-word {
        font-size: 2rem;
    }
}
