/**
 * TriviPals UI Component Styles
 * Clean, consistent design system for polished appearance
 */

/* ==================== BRAND BUTTONS ==================== */

.btn-brand {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-brand:hover {
    background: linear-gradient(135deg, #5855eb 0%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    color: white;
}

.btn-brand:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-brand:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================== SOFT BUTTONS ==================== */

.btn-soft {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #6366f1;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-soft:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #5855eb;
    transform: translateY(-1px);
}

.btn-soft:active {
    transform: translateY(0);
    background: rgba(99, 102, 241, 0.2);
}

/* ==================== GHOST BUTTONS ==================== */

.btn-ghost {
    background: transparent;
    border: none;
    color: #6b7280;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-ghost:hover {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
}

.btn-ghost:active {
    background: rgba(107, 114, 128, 0.15);
}

/* ==================== CHOICE BUTTONS ==================== */

.choice-button {
    background: white;
    border: 2px solid #e5e7eb;
    color: #374151;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    min-height: 44px; /* Touch-friendly */
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.choice-button:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.choice-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.choice-button.selected {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #6366f1;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

/* ==================== CARDS & PANELS ==================== */

.card-clean {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.card-clean:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
}

.panel-primary {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

.panel-success {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.2);
}

.panel-warning {
    background: rgba(251, 191, 36, 0.05);
    border-color: rgba(251, 191, 36, 0.2);
}

.panel-danger {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

/* ==================== TIMER BADGE ==================== */

.timer-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    animation: pulse-timer 2s infinite;
}

@keyframes pulse-timer {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
    }
}

.timer-badge.timer-warning {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse-urgent 1s infinite;
}

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

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

/* Mobile-first approach */
@media (min-width: 576px) {
    .btn-brand {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .choice-button {
        padding: 1.25rem 1.75rem;
        margin-bottom: 1rem;
    }
}

@media (min-width: 768px) {
    .card-clean {
        padding: 2rem;
        border-radius: 20px;
    }
}

/* ==================== ACCESSIBILITY ==================== */

/* High contrast for better readability */
@media (prefers-contrast: high) {
    .btn-brand {
        background: #000;
        border: 2px solid #fff;
    }
    
    .choice-button {
        border-width: 3px;
    }
}

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

/* Focus styles for keyboard navigation */
.btn-brand:focus,
.btn-soft:focus,
.choice-button:focus {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

/* ==================== TYPOGRAPHY ==================== */

.text-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.text-muted {
    color: #6b7280;
}

.text-brand {
    color: #6366f1;
}

/* ==================== SPACING & LAYOUT ==================== */

.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }

.p-xs { padding: 0.5rem; }
.p-sm { padding: 0.75rem; }
.p-md { padding: 1rem; }
.p-lg { padding: 1.5rem; }
.p-xl { padding: 2rem; }

.m-xs { margin: 0.5rem; }
.m-sm { margin: 0.75rem; }
.m-md { margin: 1rem; }
.m-lg { margin: 1.5rem; }
.m-xl { margin: 2rem; }

/* ==================== INTERACTIVE STATES ==================== */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.success-state {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
    border-color: rgba(34, 197, 94, 0.3);
}

.error-state {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}