:root {
    --background: 210 20% 98%;
    --foreground: 215 25% 15%;
    --card: 0 0% 100%;
    --card-foreground: 215 25% 15%;
    --popover: 0 0% 100%;
    --popover-foreground: 215 25% 15%;
    --primary: 195 85% 45%;
    --primary-foreground: 0 0% 100%;
    --secondary: 210 15% 95%;
    --secondary-foreground: 215 25% 15%;
    --muted: 210 15% 95%;
    --muted-foreground: 215 15% 50%;
    --accent: 195 80% 92%;
    --accent-foreground: 195 85% 35%;
    --success: 145 65% 45%;
    --success-foreground: 0 0% 100%;
    --destructive: 0 72% 55%;
    --destructive-foreground: 0 0% 100%;
    --warning: 35 95% 55%;
    --warning-foreground: 0 0% 100%;
    --border: 215 20% 88%;
    --input: 215 20% 88%;
    --ring: 195 85% 45%;
    --radius: .75rem;
    --chart-1: 195 85% 45%;
    --chart-2: 145 65% 45%;
    --chart-3: 35 95% 55%;
    --chart-4: 280 70% 60%;
    --chart-5: 0 72% 55%;
    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 240 5.9% 10%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 240 4.8% 95.9%;
    --sidebar-accent-foreground: 240 5.9% 10%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 217.2 91.2% 59.8%
}

.dark {
    --background: 215 30% 10%;
    --foreground: 210 20% 95%;
    --card: 215 25% 15%;
    --card-foreground: 210 20% 95%;
    --popover: 215 25% 15%;
    --popover-foreground: 210 20% 95%;
    --primary: 195 85% 50%;
    --primary-foreground: 0 0% 100%;
    --secondary: 215 20% 20%;
    --secondary-foreground: 210 20% 95%;
    --muted: 215 20% 20%;
    --muted-foreground: 215 15% 65%;
    --accent: 215 20% 22%;
    --accent-foreground: 195 85% 60%;
    --success: 145 65% 50%;
    --success-foreground: 0 0% 100%;
    --destructive: 0 72% 60%;
    --destructive-foreground: 0 0% 100%;
    --warning: 35 95% 60%;
    --warning-foreground: 0 0% 100%;
    --border: 215 20% 25%;
    --input: 215 20% 25%;
    --ring: 195 85% 50%;
    --chart-1: 195 85% 50%;
    --chart-2: 145 65% 50%;
    --chart-3: 35 95% 60%;
    --chart-4: 280 70% 65%;
    --chart-5: 0 72% 60%;
    --sidebar-background: 240 5.9% 10%;
    --sidebar-foreground: 240 4.8% 95.9%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 240 3.7% 15.9%;
    --sidebar-accent-foreground: 240 4.8% 95.9%;
    --sidebar-border: 240 3.7% 15.9%;
    --sidebar-ring: 217.2 91.2% 59.8%
}

* {
    border-color: hsl(var(--border));
    box-sizing: border-box;
}

html {
    line-height: 1.5;
    scroll-behavior: smooth;
    overflow-x: hidden;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}

body {
    margin: 0;
    line-height: inherit;
    overflow-x: hidden;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    -webkit-overflow-scrolling: touch;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 45;

    /* force stable rendering during transforms */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.page-content {
    padding-top: 80px;
    overflow-x: hidden;
}

img, video {
    max-width: 100%;
}

[hidden] {
    display: none;
}

.border-destructive {
    border-color: #dc2626 !important;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg fill='none' stroke='%239CA3AF' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

.waves-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.waves-btn .wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    pointer-events: none;
    animation: wave-ripple 0.8s linear;
}

@keyframes wave-ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.loader {
    display: inline-block;
    width: 64px;
    height: 64px;
    border: 8px solid rgba(255, 255, 255, 0.2);
    border-top-color: #3498db; /* main color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.6), 0 0 20px rgba(52, 152, 219, 0.4);
}

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

/* Optional: smooth fade-in for overlay */
#loadingOverlay {
    transition: opacity 0.3s ease;
}

#loadingOverlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#loadingOverlay:not(.hidden) {
    opacity: 1;
}

/* Pull to Refresh - Perfect Center Fix */
#pullToRefresh {
    left: 50% !important;
    transform: translateX(-50%) translateY(-100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
    opacity: 0;
}

/* Visible State */
#pullToRefresh.show {
    transform: translateX(-50%) translateY(12px);
    opacity: 1;
}

/* Loader spinner */
.pull-loader {
    border-color: rgba(255,255,255,0.3);
    border-top-color: currentColor;
}
