/* CSS Variables for theming */
:root {
    --theme-primary: #8b5cf6;
    --theme-secondary: #7c3aed;
    --theme-background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --theme-question: linear-gradient(135deg, #e9d5ff 0%, #f3e8ff 100%);
    --theme-success: #22c55e;
    --theme-danger: #ef4444;
    --theme-info: #3b82f6;
}

/* Theme variations */
.theme-purple {
    --theme-primary: #8b5cf6;
    --theme-secondary: #7c3aed;
    --theme-background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --theme-question: linear-gradient(135deg, #e9d5ff 0%, #f3e8ff 100%);
}

.theme-blue {
    --theme-primary: #3b82f6;
    --theme-secondary: #2563eb;
    --theme-background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --theme-question: linear-gradient(135deg, #bfdbfe 0%, #dbeafe 100%);
}

.theme-green {
    --theme-primary: #22c55e;
    --theme-secondary: #16a34a;
    --theme-background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --theme-question: linear-gradient(135deg, #bbf7d0 0%, #dcfce7 100%);
}

.theme-red {
    --theme-primary: #ef4444;
    --theme-secondary: #dc2626;
    --theme-background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --theme-question: linear-gradient(135deg, #fecaca 0%, #fee2e2 100%);
}

.theme-orange {
    --theme-primary: #f97316;
    --theme-secondary: #ea580c;
    --theme-background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --theme-question: linear-gradient(135deg, #fed7aa 0%, #ffedd5 100%);
}

.theme-yellow {
    --theme-primary: #eab308;
    --theme-secondary: #ca8a04;
    --theme-background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    --theme-question: linear-gradient(135deg, #fef08a 0%, #fef9c3 100%);
}

.theme-pink {
    --theme-primary: #ec4899;
    --theme-secondary: #db2777;
    --theme-background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    --theme-question: linear-gradient(135deg, #fbcfe8 0%, #fce7f3 100%);
}

.theme-indigo {
    --theme-primary: #6366f1;
    --theme-secondary: #4f46e5;
    --theme-background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --theme-question: linear-gradient(135deg, #c7d2fe 0%, #e0e7ff 100%);
}

.theme-teal {
    --theme-primary: #14b8a6;
    --theme-secondary: #0d9488;
    --theme-background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    --theme-question: linear-gradient(135deg, #99f6e4 0%, #ccfbf1 100%);
}

.theme-cyan {
    --theme-primary: #06b6d4;
    --theme-secondary: #0891b2;
    --theme-background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --theme-question: linear-gradient(135deg, #a5f3fc 0%, #cffafe 100%);
}

/* Base styles */
body {
    background: var(--theme-background);
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Theme indicator line */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--theme-secondary);
    z-index: 9999;
}

/* Pattern overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 0, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Game container */
.box.game-container {
    background: var(--theme-question);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 4px solid var(--theme-secondary);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Title styling */
.title {
    color: var(--theme-primary);
    font-family: 'Comic Neue', cursive !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em;
}

.game-container h1.title {
    font-family: 'Comic Neue', cursive !important;
    font-weight: 400 !important;
    margin-bottom: 2rem !important;
}

/* Section spacing */
.section {
    padding: 3rem 1.5rem;
}

/* Override Bulma column padding */
.column {
    padding: 0 !important;
}

/* Progress bar */
.progress-info {
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 32px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border-radius: 20px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Karla', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: white;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Question container */
.question-container {
    background: var(--theme-primary);
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 2px solid var(--theme-secondary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#question-text {
    font-family: 'Inter', sans-serif;
    color: white;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Clock display */
.clock-display {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    min-height: 250px;
    border: 3px solid var(--theme-secondary);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.clock-svg {
    width: 200px;
    height: 200px;
    transition: transform 0.3s ease;
}

.clock-svg:hover {
    transform: scale(1.05);
}

/* Answer section */
.answer-section {
    display: flex;
    justify-content: center;
}

.answer-controls {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.time-separator {
    font-size: 1.5rem;
    font-family: 'Karla', sans-serif;
    color: var(--theme-primary);
    padding: 0 0.5rem;
    font-weight: 600;
}

#hour-input,
#minute-input {
    font-size: 1.5rem;
    font-family: 'Karla', sans-serif;
    text-align: center;
    width: 80px;
    border: none;
    height: 50px;
    -moz-appearance: textfield; /* Firefox */
    -webkit-appearance: none;
    box-sizing: border-box;
    margin: 0;
    padding: 0 0.5rem;
    outline: none;
    background: transparent;
    color: var(--theme-primary);
}

/* Remove number input spinners */
#hour-input::-webkit-inner-spin-button,
#hour-input::-webkit-outer-spin-button,
#minute-input::-webkit-inner-spin-button,
#minute-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#hour-input[type=number],
#minute-input[type=number] {
    -moz-appearance: textfield;
}

#hour-input {
    padding-left: 1.5rem;
}

#hour-input:focus,
#minute-input:focus {
    background: rgba(139, 92, 246, 0.05); /* Light purple tint */
}

#minute-input[readonly] {
    cursor: not-allowed;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.02);
}

#submit-btn {
    font-size: 1.2rem;
    font-family: 'Karla', sans-serif;
    border-radius: 0 10px 10px 0;
    background: linear-gradient(45deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: white;
    border: none;
    height: 50px;
    padding: 0 1.5rem;
    box-sizing: border-box;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
}

#submit-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, var(--theme-accent) 0%, var(--theme-primary) 100%);
}

#submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feedback message */
.feedback-message {
    margin: 2rem auto;
    max-width: 600px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-size: 1.2rem;
    text-align: center;
    font-weight: 600;
}

.feedback-message.is-success {
    background: var(--theme-success);
    color: white;
}

.feedback-message.is-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 2px solid #fca5a5;
}

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

/* Next button */
#next-btn {
    margin-top: 1rem;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    background: linear-gradient(45deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

#next-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Result card */
.result-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--theme-primary);
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#final-score {
    font-size: 3rem;
    margin: 1rem 0;
    animation: zoomIn 0.5s ease-out;
    color: var(--theme-primary);
    font-weight: 900;
}

@keyframes zoomIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.result-message {
    font-size: 1.3rem;
    color: var(--theme-primary);
    margin: 1.5rem 0;
}

#play-again-btn {
    margin: 1.5rem 0 0;
    font-size: 1.2rem;
    padding: 1rem 2.5rem;
    border-radius: 30px;
    background: linear-gradient(45deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
    display: inline-block;
}

#play-again-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Result screen text styling */
#result-screen .title {
    color: var(--theme-primary);
}

#result-screen .subtitle {
    color: var(--theme-secondary);
}

#time-taken {
    color: var(--theme-primary);
    background: rgba(139, 92, 246, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-container h1.title {
        font-size: 1.1rem !important;
    }
    
    #hour-input,
    #minute-input {
        font-size: 1.5rem;
        width: 60px;
    }
    
    .time-separator {
        font-size: 1.5rem;
    }
    
    #submit-btn {
        font-size: 1.1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .clock-svg {
        width: 180px;
        height: 180px;
    }
    
    .progress-bar {
        height: 28px;
    }
    
    .progress-timer {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding-top: 1.5rem;
    }
    
    .game-container h1.title {
        font-size: 1rem !important;
    }
    
    .box.game-container {
        padding: 1.5rem;
    }
    
    #question-text {
        font-size: 1.1rem;
    }
    
    
    #hour-input,
    #minute-input {
        font-size: 1.25rem;
        width: 50px;
    }
    
    .time-separator {
        font-size: 1.25rem;
        padding: 0 0.5rem;
    }
    
    #submit-btn {
        font-size: 1rem;
        padding: 0.6rem 2rem;
        width: 100%;
        max-width: 200px;
    }
    
    .clock-display {
        padding: 1rem;
        min-height: 180px;
    }
    
    .clock-svg {
        width: 160px;
        height: 160px;
    }
    
    #final-score {
        font-size: 2.5rem;
    }
    
    .result-message {
        font-size: 1.1rem;
    }
    
    #play-again-btn {
        font-size: 1rem;
        padding: 0.75rem 2rem;
    }
    
    .progress-bar {
        height: 26px;
    }
    
    .progress-timer {
        font-size: 1rem;
    }
}

@media (max-width: 360px) {
    .section {
        padding: 1.5rem 0.75rem;
    }
    
    .box.game-container {
        padding: 0.75rem;
    }
    
    .game-container .title {
        font-size: 0.9rem !important;
        line-height: 1.3;
    }
    
    #question-text {
        font-size: 1rem;
    }
    
    .clock-svg {
        width: 140px;
        height: 140px;
    }
    
    .clock-display {
        padding: 0.75rem;
        min-height: 160px;
    }
    
    .progress-bar {
        height: 24px;
    }
    
    .progress-timer {
        font-size: 0.9rem;
    }
}

/* Hide elements */
.is-hidden {
    display: none !important;
}

/* Sticky footer styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}
