/* Reset default margins and ensure scrollability */
*, *:before, *:after {
    box-sizing: border-box; /* Ensure consistent sizing */
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: auto; /* Prevent clipping */
}

body {
    font-family: Arial, sans-serif;
    transition: all 0.3s ease;
}

/* Light and dark mode base styles */
.light-mode {
    background-color: #f0f0f0;
    color: #000000;
}

.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* Header styles */
header {
    background-color: #f1f1f1;
    padding: 0.5rem;
    text-align: center;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000;
    width: 100%;
    width: calc(100% - 1rem); /* Fallback for IE6/7 */
}

.dark-mode header {
    background-color: #333;
}

/* Prevent content overlap with header */
body {
    padding-top: 40px; /* Default for desktop */
}

/* Navigation styles */
header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

header nav ul li {
    margin: 0 0.5rem;
}

/* Theme toggle button */
.toggle-container {
    text-align: center;
    padding: 1rem;
}

#theme-toggle {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #999;
    border-radius: 5px;
    background-color: #e0e0e0;
    color: #000000;
}

.dark-mode #theme-toggle {
    background-color: #333;
    color: #ffffff;
    border-color: #666;
}

#theme-toggle:hover {
    background-color: #d0d0d0;
}

.dark-mode #theme-toggle:hover {
osk    background-color: #444;
}

/* Links */
a {
    color: #0066cc;
    text-decoration: none;
}

.dark-mode a {
    color: #66b3ff;
}

/* Bingo card styles */
#bingoCard {
    border: 4px solid black;
    border-collapse: collapse;
    width: 100%;
    max-width: 600px;
    margin: 1rem auto;
}

#bingoCard td, #bingoCard th {
    border: 2px solid black;
    text-align: center;
    padding: 12px;
    font-size: 24px;
}

.suit-header {
    font-weight: bold;
    font-size: 96px;
}

#bingoCard td:nth-child(1), #bingoCard th:nth-child(1) { /* Clubs - Black */
    color: black;
}

#bingoCard td:nth-child(2), #bingoCard th:nth-child(2) { /* Spades - Black */
    color: black;
}

#bingoCard td:nth-child(3), #bingoCard th:nth-child(3) { /* Hearts - Red */
    color: red;
}

#bingoCard td:nth-child(4), #bingoCard th:nth-child(4) { /* Diamonds - Red */
    color: red;
}

/* Converter and tweet container */
#converter, #tweetContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 1rem auto;
}

.dark-mode #converter, .dark-mode #tweetContainer {
    background-color: #2a2a2a;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Form elements */
input, button {
    margin: 5px 0;
    padding: 10px;
    font-size: 16px;
}

input {
    width: 300px;
    max-width: 100%;
}

button {
    cursor: pointer;
    background-color: #000000;
    color: white;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode button {
    background-color: #444;
}

button:hover {
    background-color: #005bb5;
}

.dark-mode button:hover {
    background-color: #66b3ff;
}

/* Icons and instructions */
.icon {
    margin-right: 10px;
}

.instructions {
    margin: 10px 0;
    font-size: 14px;
    text-align: center;
    max-width: 300px;
    color: #333;
}

.dark-mode .instructions {
    color: #ccc;
}

/* Loading spinner */
#embedLoader {
    display: none;
    text-align: center;
    margin: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 2s linear infinite;
}

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

/* Greenscreen mode */
.greenscreen {
    background-color: #04F404;
}

/* Print styles */
@media print {
    body * {
        visibility: hidden;
    }
    #bingoCard, #bingoCard *, h1 {
        visibility: visible;
    }
    #bingoCard {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    h1 {
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
    }
    button {
        display: none;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    header {
        padding: 0.5rem;
    }
    body {
        padding-top: 32px; /* Adjusted for mobile */
    }
    header nav ul {
        flex-direction: column;
        margin: 0.5rem 0;
    }
    header nav ul li {
        margin: 0.25rem 0;
    }
    #bingoCard {
        max-width: 100%;
    }
    input {
        width: 100%;
    }
}

/* Orientation-specific adjustments */
@media (orientation: landscape) and (max-width: 896px) {
    header {
        padding: 0.3rem;
    }
    body {
        padding-top: 24px; /* Smaller for landscape */
    }
}