/**
 * Bingo Game Custom Styles
 * Mobile-first responsive design
 */

/* Root variables for consistent theming */
:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Body and general styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Container adjustments for mobile */
.container-fluid {
    max-width: 100%;
    padding: 10px;
    overflow-x: hidden;
}

/* Header styles */
header {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem !important;
}

header h1 {
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Card styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Button styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Bingo grid styles */
.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 10px;
    max-width: 100%;
    margin: 0 auto;
}

/* Bingo cell styles */
.bingo-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.65rem;
    font-weight: 500;
    text-align: center;
    padding: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
    word-wrap: break-word;
    hyphens: auto;
    line-height: 1.1;
    min-height: 0;
}

.bingo-cell:hover {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.bingo-cell:active {
    transform: scale(0.95);
}

/* Marked cell styles */
.bingo-cell.marked {
    background: linear-gradient(145deg, var(--success-color), #218838);
    color: white;
    border-color: #1e7e34;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.bingo-cell.marked:hover {
    background: linear-gradient(145deg, #218838, #1e7e34);
    transform: scale(1.05);
}

/* Hash display styles */
#cardHash {
    background: rgba(108, 117, 125, 0.1);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-top: 15px;
}

#hashValue {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--primary-color);
    word-break: break-all;
}

/* Instructions card */
.card-title {
    color: var(--primary-color);
    font-weight: 600;
}

/* Alert styles */
.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

/* Footer styles */
footer {
    margin-top: 2rem;
    padding: 1rem 0;
}

/* Responsive adjustments */
@media (min-width: 576px) {
    .container-fluid {
        padding: 20px;
    }
    
    .bingo-cell {
        font-size: 0.7rem;
        padding: 3px;
    }
    
    .bingo-grid {
        gap: 10px;
        padding: 15px;
        max-width: 500px;
    }
}

@media (min-width: 768px) {
    .bingo-cell {
        font-size: 0.75rem;
        padding: 4px;
    }
    
    .bingo-grid {
        gap: 12px;
        padding: 20px;
    }
}

@media (min-width: 992px) {
    .container-fluid {
        max-width: 800px;
        margin: 0 auto;
    }
    
    .bingo-cell {
        font-size: 0.8rem;
        padding: 6px;
    }
}

/* Animation for card appearance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#bingoCard {
    animation: fadeInUp 0.5s ease-out;
}

/* Loading animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .bingo-cell {
        min-height: 60px;
        font-size: 0.6rem;
        padding: 1px;
        line-height: 1.0;
    }
    
    .btn {
        min-height: 48px;
        font-size: 1.1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bingo-cell {
        border-width: 3px;
    }
    
    .bingo-cell.marked {
        background: #000;
        color: #fff;
        border-color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .card {
        background: rgba(52, 58, 64, 0.95);
        color: #fff;
    }
    
    .bingo-cell {
        background: linear-gradient(145deg, #495057, #343a40);
        color: #fff;
        border-color: #6c757d;
    }
    
    .bingo-cell:hover {
        background: linear-gradient(145deg, #6c757d, #495057);
    }
}