/*
 * Bingo Card Maker - Dark Theme Specific Styles
 * Extends worksheet-base.css
 * Matches Math/Word Search visual style
 */

/* ============================================
   BINGO CARD CONTAINER
   ============================================ */
.bingo-cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
    width: 100%;
    padding: 10px 0;
}

.bingo-cards-wrapper.cards-2,
.bingo-cards-wrapper.cards-4 {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
}

/* ============================================
   BINGO CARD
   ============================================ */
.bingo-card {
    border: 2px solid #000; /* Solid black for crisp look */
    border-radius: 0; /* Sharp corners like math sheets */
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.bingo-card--large {
    width: 100%;
    max-width: 160mm; /* Constrain width for A4 */
}

.bingo-card--medium {
    width: calc(50% - 14px);
    max-width: 90mm;
}

.bingo-card--small {
    width: calc(50% - 14px);
    max-width: 85mm;
}

/* Card Header */
.bingo-card__header {
    display: flex;
    justify-content: center;
    background: #1e293b; /* Dark header */
    border-bottom: 2px solid #000;
}

.bingo-card__letter {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 32px;
    font-weight: 900;
    color: white;
    font-family: var(--font-ui);
    letter-spacing: 2px;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.bingo-card__letter:last-child {
    border-right: none;
}

.bingo-card--medium .bingo-card__letter {
    font-size: 20px;
    padding: 8px 0;
}

.bingo-card--small .bingo-card__letter {
    font-size: 16px;
    padding: 6px 0;
}

/* Card Grid */
.bingo-card__grid {
    display: grid;
    background: #000; /* Gap color becomes border */
    gap: 1px; /* Creates the grid lines */
    border-bottom: 1px solid #000;
}

.bingo-card__grid.size-3 { grid-template-columns: repeat(3, 1fr); }
.bingo-card__grid.size-4 { grid-template-columns: repeat(4, 1fr); }
.bingo-card__grid.size-5 { grid-template-columns: repeat(5, 1fr); }

.bingo-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-sheet); /* Monospace for alignment */
    color: #1e293b;
    padding: 4px;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
}

.bingo-card--medium .bingo-cell {
    font-size: 12px;
}

.bingo-card--small .bingo-cell {
    font-size: 10px;
    padding: 2px;
}

/* Adjust font size based on content length */
.bingo-cell.text-sm { font-size: 14px; }
.bingo-cell.text-xs { font-size: 11px; }

.bingo-card--medium .bingo-cell.text-sm { font-size: 10px; }
.bingo-card--medium .bingo-cell.text-xs { font-size: 8px; }

.bingo-card--small .bingo-cell.text-sm { font-size: 8px; }
.bingo-card--small .bingo-cell.text-xs { font-size: 7px; }

/* Free Space */
.bingo-cell--free {
    background: #f1f5f9; /* Light gray for free space */
    color: #000;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    position: relative;
}

/* Star Icon for Free Space */
.bingo-cell--free::after {
    content: "★";
    display: block;
    font-size: 24px;
    color: #000;
    line-height: 1;
}

.bingo-cell--free span {
    display: none; /* Hide text if we use icon, or style it */
}

.bingo-card--medium .bingo-cell--free::after {
    font-size: 16px;
}

.bingo-card--small .bingo-cell--free::after {
    font-size: 14px;
}

/* Card Number Label */
.bingo-card__number {
    text-align: center;
    padding: 6px;
    font-size: 10px;
    color: #64748b;
    background: white;
    font-family: var(--font-ui);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .bingo-cards-wrapper {
        gap: 20px;
    }

    .bingo-card {
        border: 2px solid #000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .bingo-card__header {
        background: #000 !important; /* Solid black header for print */
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .bingo-card__letter {
        color: white !important;
        border-right: 1px solid white !important;
    }
    
    .bingo-card__grid {
        background: #000 !important;
        gap: 1px !important;
    }

    .bingo-cell {
        background: white !important;
        color: black !important;
    }
    
    .bingo-cell--free {
        background: #eee !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .bingo-cell--free::after {
        color: #000 !important;
    }
    
    .bingo-card__number {
        color: #000 !important;
    }
}

/* ============================================
   CALL SHEET
   ============================================ */
.call-sheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    width: 100%;
    margin-top: 20px;
    border: 2px solid #000;
    background: #000; /* Creates the grid lines via gap */
    gap: 1px;
}

.call-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    min-height: 40px;
}

.call-value {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
}

.call-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #000;
    background: white;
    flex-shrink: 0;
}

@media print {
    .call-sheet-grid {
        grid-template-columns: repeat(5, 1fr); /* 5 columns for efficient printing */
        border: 2px solid #000;
        background: #000 !important;
        gap: 1px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .call-item {
        background: white !important;
        padding: 6px 8px;
        border: none; /* Grid handles borders */
    }
    
    .call-checkbox {
        border: 1px solid #000;
        width: 14px;
        height: 14px;
    }
    
    .call-value {
        font-size: 11px;
    }
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1024px) {
    .bingo-cards-wrapper {
        gap: clamp(12px, 3vw, 24px);
        padding: 8px 0;
        width: 100%;
    }
    
    .bingo-card--large {
        max-width: 90%;
        width: 100%;
    }
    
    .bingo-card--medium {
        width: calc(50% - 8px);
        max-width: none;
    }
    
    .bingo-card--small {
        width: calc(50% - 6px);
        max-width: none;
    }
    
    .bingo-cell {
        font-size: clamp(10px, 2.5vw, 18px);
    }
    
    .bingo-card__letter {
        font-size: clamp(16px, 5vw, 32px);
        padding: clamp(6px, 2vw, 12px) 0;
    }
    
    .bingo-card--medium .bingo-card__letter {
        font-size: clamp(12px, 3vw, 20px);
        padding: clamp(4px, 1.5vw, 8px) 0;
    }
    
    .bingo-card--small .bingo-card__letter {
        font-size: clamp(10px, 2.5vw, 16px);
        padding: clamp(3px, 1vw, 6px) 0;
    }
}

@media (max-width: 600px) {
    .bingo-cards-wrapper {
        gap: clamp(8px, 2vw, 16px);
        padding: 4px 0;
    }
    
    .bingo-cards-wrapper.cards-2,
    .bingo-cards-wrapper.cards-4 {
        gap: clamp(6px, 1.5vw, 12px);
    }
    
    .bingo-card--large {
        max-width: 95%;
    }
    
    .bingo-card--medium {
        width: calc(50% - 4px);
    }
    
    .bingo-card--small {
        width: calc(50% - 3px);
    }
    
    .bingo-cell {
        font-size: clamp(8px, 2vw, 12px);
        padding: 2px;
    }
    
    .bingo-cell--free::after {
        font-size: clamp(12px, 4vw, 24px);
    }
    
    .bingo-card--medium .bingo-cell--free::after {
        font-size: clamp(10px, 3vw, 16px);
    }
    
    .bingo-card--small .bingo-cell--free::after {
        font-size: clamp(8px, 2.5vw, 14px);
    }
    
    .bingo-card__number {
        font-size: clamp(7px, 1.8vw, 10px);
        padding: 3px;
    }
    
    /* Call sheet for mobile */
    .call-sheet-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .call-item {
        padding: 6px;
        gap: 6px;
    }
    
    .call-value {
        font-size: clamp(10px, 2.5vw, 13px);
    }
    
    .call-checkbox {
        width: 14px;
        height: 14px;
    }
}

