/* SHARPCHAT PWA Styles */

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Variables are defined in base template */

/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.hidden { display: none !important; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-up {
    animation: slideUp 0.3s ease;
}

.animate-pulse {
    animation: pulse 2s ease infinite;
}

/* Game-specific styles */
.question-card {
    background: linear-gradient(135deg, var(--accent), var(--bg-card));
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.answer-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.answer-option:hover {
    border-color: var(--primary);
    background: var(--accent);
}

.answer-option.selected {
    border-color: var(--primary);
    background: rgba(255, 215, 0, 0.1);
}

.answer-option.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.answer-option.incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Timer */
.game-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--accent);
    border-radius: 12px;
    margin-bottom: 16px;
}

.timer-value {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.timer-value.warning {
    color: var(--warning);
}

.timer-value.danger {
    color: var(--danger);
    animation: pulse 0.5s ease infinite;
}

/* Progress bar */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Result screens */
.result-win {
    text-align: center;
    padding: 40px 20px;
}

.result-win .emoji {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.result-win .prize-amount {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.result-lose {
    text-align: center;
    padding: 40px 20px;
}

.result-lose .emoji {
    font-size: 64px;
    margin-bottom: 20px;
}

/* Confetti animation for wins */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Pull to refresh indicator */
.pull-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: var(--primary);
    color: var(--secondary);
    border-radius: 0 0 12px 12px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
}

.pull-indicator.visible {
    opacity: 1;
}

/* Safe area padding for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .app-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }
    
    .bottom-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

/* Dark mode overrides (already dark by default) */
@media (prefers-color-scheme: light) {
    /* Keep dark theme regardless of system preference */
}

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