/* Grid Frame Styling - Mobile First */
.grid-frame {
    display: grid;
    grid-template-columns: repeat(8, 25px);
    grid-template-rows: repeat(8, 25px);
    background-color: #d3d3d3; /* light grey */
    border: 3px solid black;
    border-radius: 8px;
    padding: 0;
    width: fit-content;
}

/* Larger grid on tablets and up */
@media (min-width: 640px) {
    .grid-frame {
        grid-template-columns: repeat(8, 30px);
        grid-template-rows: repeat(8, 30px);
        border: 5px solid black;
    }
}

/* Grid Cell Styling - Mobile First */
.grid-cell {
    width: 25px;
    height: 25px;
    border: 1px solid black;
    box-sizing: border-box;
}

/* Larger cells on tablets and up */
@media (min-width: 640px) {
    .grid-cell {
        width: 30px;
        height: 30px;
    }
}

/* Tab Button Styling */
.tab-button {
    background-color: #e5e7eb;
    color: #374151;
    border: none;
    cursor: pointer;
}

.tab-button:hover {
    background-color: #d1d5db;
}

.tab-button.active {
    background-color: #3b82f6;
    color: white;
}

/* Legend Text Styling - Mobile First */
.legend-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: 0.3em;
    white-space: pre;
    overflow-x: auto;
}

/* Larger legend text on tablets and up */
@media (min-width: 640px) {
    .legend-text {
        font-size: 16px;
        line-height: 1.5;
        letter-spacing: 0.5em;
    }
}

/* Block Colors */
.block-dark-grey {
    background-color: #4a5568;
}

.block-blue {
    background-color: #3b82f6;
}

.block-yellow {
    background-color: #fbbf24;
}

.block-white {
    background-color: #ffffff;
}

.block-red {
    background-color: #ef4444;
}

.block-empty {
    background-color: transparent;
}

/* Loading Spinner Styling - Mobile Optimized */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner.hidden {
    display: none;
}

.loading-content {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 0 16px;
    max-width: 90%;
}

@media (min-width: 640px) {
    .loading-content {
        padding: 40px;
        max-width: none;
        margin: 0;
    }
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

@media (min-width: 640px) {
    .spinner {
        width: 50px;
        height: 50px;
        margin: 0 auto 20px auto;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

@media (min-width: 640px) {
    .loading-text {
        font-size: 18px;
    }
}
