/* ===================================
   TRIVIA TRAINER - DARK MODE STYLING
   =================================== */

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Container */
.container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* Space for fixed button bar */
}

/* Header */
.header {
    background-color: #0d0d0d;
    padding: 12px;
    text-align: center;
    border-bottom: 2px solid #8b5cf6;
}

.logo {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #8b5cf6;
    opacity: 0.8;
}

/* Loading Indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #8b5cf6;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #8b5cf6;
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* ===================================
   REGULAR CATEGORY MODE
   =================================== */

.category-mode {
    flex: 1;
    padding: 20px;
    background-color: #1a1a1a;
}

.category-header {
    margin-bottom: 30px;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 15px 20px;
    background-color: #2a2a2a;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    max-width: 300px;
    margin: 0 auto 30px;
}

/* Clues Container - Always Single Column */
.clues-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    margin: 0 auto;
}

/* Individual Clue Card - Flexible Height */
.clue-card {
    background-color: transparent;
    perspective: 1000px;
    min-height: 120px;
    cursor: pointer;
}

.clue-card-inner {
    position: relative;
    width: 100%;
    min-height: 120px;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    transform-style: preserve-3d;
}

.clue-card.flipped .clue-card-inner {
    transform: rotateX(10deg) scale(0.98);
}

.clue-card:active {
    transform: scale(0.98);
}

.clue-card-front,
.clue-card-back {
    width: 100%;
    min-height: 120px;
    backface-visibility: hidden;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s ease-in-out;
}

.clue-card-front {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    border: 2px solid #3a3a3a;
    opacity: 1;
    position: relative;
}

.clue-card.flipped .clue-card-front {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.clue-card-back {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    border: 2px solid #8b5cf6;
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.clue-card.flipped .clue-card-back {
    opacity: 1;
    position: relative;
}

.clue-value {
    display: none; /* Hide money values */
}

.clue-text {
    font-size: 0.95rem;
    color: #ffffff;
    line-height: 1.5;
    font-weight: 500;
}

.clue-answer {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.5;
}

.clue-answer::before {
    content: "✓ ";
    font-size: 1.2rem;
    margin-right: 6px;
}

/* ===================================
   CHALLENGE MODE
   =================================== */

.final-jeopardy-mode {
    flex: 1;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.final-jeopardy-container {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.final-jeopardy-title {
    font-size: 2rem;
    font-weight: bold;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 40px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.final-category {
    background-color: #2a2a2a;
    border: 4px solid #8b5cf6;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.7);
}

.final-label {
    font-size: 1rem;
    color: #b0b0b0;
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.final-category-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.final-clue {
    background-color: #2a2a2a;
    border: 3px solid #3a3a3a;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.6s ease-in;
}

.final-clue-text {
    font-size: 1.3rem;
    color: #ffffff;
    line-height: 1.6;
}

.final-answer {
    background-color: #2a2a2a;
    border: 4px solid #8b5cf6;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.final-answer-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #8b5cf6;
}

.final-reveal-btn,
.final-new-btn {
    width: 100%;
    padding: 18px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background-color: #8b5cf6;
    color: #ffffff;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
    min-height: 44px;
}

.final-reveal-btn:active,
.final-new-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background-color: #a78bfa;
}

/* ===================================
   BOTTOM BUTTON BAR
   =================================== */

.button-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 10px;
    padding: 15px;
    background-color: #0d0d0d;
    border-top: 3px solid #8b5cf6;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.5);
}

.btn {
    flex: 1;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: bold;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    min-height: 44px; /* Touch-friendly */
}

.btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.btn-primary {
    background-color: #8b5cf6;
    color: #ffffff;
}

.btn-secondary {
    background-color: #2a2a2a;
    color: #8b5cf6;
    border-color: #8b5cf6;
}

.btn-secondary:active {
    background-color: #3a3a3a;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Small phones (320px+) - default styles above */

/* Medium phones and larger (375px+) */
@media (min-width: 375px) {
    .logo {
        font-size: 0.95rem;
    }
    
    .category-name {
        font-size: 1.15rem;
    }
    
    .clue-text {
        font-size: 1rem;
    }
}

/* Large phones (425px+) */
@media (min-width: 425px) {
    .category-name {
        font-size: 1.2rem;
    }
    
    .final-jeopardy-title {
        font-size: 2rem;
    }
}

/* Tablets (768px+) */
@media (min-width: 768px) {
    .container {
        padding-bottom: 90px;
    }
    
    .category-mode {
        padding: 40px;
    }
    
    .clues-container {
        max-width: 300px;
    }
    
    .category-name {
        font-size: 1.3rem;
    }
    
    .button-bar {
        padding: 20px 40px;
    }
    
    .btn {
        font-size: 1.1rem;
        padding: 18px 30px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .clues-container {
        max-width: 300px;
    }
    
    .logo {
        font-size: 1rem;
    }
}

/* Landscape orientation optimization */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 8px;
    }
    
    .logo {
        font-size: 0.85rem;
    }
    
    .category-header {
        margin-bottom: 15px;
    }
    
    .category-name {
        padding: 15px;
        font-size: 1.3rem;
    }
}

