/* ====== BASE ====== */
* {
    -webkit-tap-highlight-color: transparent;
}
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== CARD SYSTEM (solid, warm shadows) ====== */
.card {
    background: #FFFFFF;
    border: 1px solid #E8E5DF;
    border-radius: 0.625rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.02);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-hover {
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.card-hover:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
    border-color: #D4CFC7;
    transform: translateY(-1px);
}
.dark .card {
    background: #1E1E1C;
    border-color: #2E2E2B;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.1);
}
.dark .card-hover:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.15);
    border-color: #3A3A37;
}

/* ====== NAVIGATION ====== */
.top-bar {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #E8E5DF;
}
.dark .top-bar {
    background: rgba(20,20,19,0.92);
    border-bottom-color: #2A2A28;
}
.bottom-bar {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #E8E5DF;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.dark .bottom-bar {
    background: rgba(20,20,19,0.92);
    border-top-color: #2A2A28;
}

/* ====== FORM INPUTS ====== */
.input {
    background: #FFFFFF;
    border: 1px solid #E2DCD2;
    border-radius: 0.625rem;
    color: #2C2925;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus {
    border-color: #357A47;
    box-shadow: 0 0 0 3px rgba(53, 122, 71, 0.12);
    outline: none;
}
.input::placeholder {
    color: #A09A90;
}
.dark .input {
    background: #1A1A18;
    border-color: #2E2E2B;
    color: #E8E5DF;
}
.dark .input:focus {
    border-color: #4D8A5B;
    box-shadow: 0 0 0 3px rgba(77, 138, 91, 0.15);
}
.dark .input::placeholder {
    color: #55524C;
}

/* ====== ANIMATIONS ====== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
}
@keyframes slideOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}
.animate-slide-out {
    animation: slideOut 0.2s ease-in forwards;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}
.animate-pulse-dot {
    animation: pulseDot 2s ease-in-out infinite;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.animate-shimmer {
    background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.02) 50%, rgba(0,0,0,0) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ====== UTILITY CLASSES ====== */
.press {
    transition: transform 0.1s ease;
}
.press:active {
    transform: scale(0.97);
}
.progress-bar-animated {
    transition: width 0.7s ease-out;
}
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}
.tabular-nums {
    font-variant-numeric: tabular-nums;
}
.odds-track {
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}
.odds-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 550;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.divider {
    height: 1px;
    background: #E8E5DF;
}
.dark .divider {
    background: #2E2E2B;
}

/* ====== HTMX STATES ====== */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator {
    opacity: 1;
}
.htmx-request .htmx-hide-on-request {
    opacity: 0.5;
    pointer-events: none;
}

/* ====== PREDICTION MARKETS ====== */
.prediction-track { position: relative; }
.prediction-dot { z-index: 1; transition: transform 0.15s ease; }
.prediction-tooltip { z-index: 20; }

/* Range slider */
.range-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 8px; border-radius: 4px;
    background: #E8E5DF; border: 1px solid #E2DCD2; outline: none; cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 24px; height: 24px; border-radius: 50%;
    background: #2D6B3E; border: 3px solid rgba(255,255,255,0.3); cursor: pointer;
    box-shadow: 0 2px 8px rgba(45,107,62,0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15); box-shadow: 0 2px 16px rgba(45,107,62,0.4);
}
.range-slider::-moz-range-thumb {
    width: 24px; height: 24px; border-radius: 50%;
    background: #2D6B3E; border: 3px solid rgba(255,255,255,0.3); cursor: pointer;
    box-shadow: 0 2px 8px rgba(45,107,62,0.3);
}
.range-slider::-moz-range-track {
    height: 8px; border-radius: 4px;
    background: #E8E5DF; border: 1px solid #E2DCD2;
}
.dark .range-slider { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); }
.dark .range-slider::-webkit-slider-thumb { border-color: rgba(0,0,0,0.3); }
.dark .range-slider::-moz-range-thumb { border-color: rgba(0,0,0,0.3); }
.dark .range-slider::-moz-range-track { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); }

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.14); }
.dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); }
.dark ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }
