:root {
    /* Core dark background */
    --bg-primary: #070b14;
    --bg-secondary: #0f1420;
    --bg-tertiary: #1a1f2e;

    /* Vibrant gradients */
    --gradient-start: #0b1020;
    --gradient-end: #1a0b2e;
    --aurora-1: #7c3aed;
    --aurora-2: #ec4899;
    --aurora-3: #3b82f6;
    --aurora-4: #f59e0b;

    /* Glass surfaces */
    --container-bg: rgba(15, 20, 35, 0.82);
    --surface-bg: rgba(25, 30, 50, 0.55);
    --surface-border: rgba(130, 120, 255, 0.16);
    --surface-hover: rgba(45, 50, 80, 0.6);

    /* Accent colors */
    --primary-color: #8b5cf6;
    --primary-hover: #a78bfa;
    --primary-soft: rgba(139, 92, 246, 0.2);
    --primary-glow: 0 0 24px rgba(139, 92, 246, 0.45);

    --secondary-color: #f59e0b;
    --secondary-hover: #fbbf24;
    --secondary-soft: rgba(245, 158, 11, 0.18);

    --accent-color: #ec4899;
    --accent-hover: #f472b6;
    --accent-soft: rgba(236, 72, 153, 0.18);

    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;

    /* Text palette */
    --text-primary: #f8fafc;
    --text-secondary: #b0b8cc;
    --text-muted: #7c8499;

    /* Input styling */
    --input-bg: rgba(20, 25, 45, 0.75);
    --input-border: rgba(130, 120, 255, 0.25);
    --input-focus: rgba(139, 92, 246, 0.55);

    /* Shadows & depth */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.25);
    --shadow-neumorphic: 8px 8px 20px rgba(0,0,0,0.5), -8px -8px 20px rgba(80,70,150,0.15);

    /* Radii */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Motion */
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Sora', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ---------- Base Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(145deg, var(--gradient-start), var(--gradient-end));
    background-attachment: fixed;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
    transition: background 0.5s ease;
}

/* ---------- Optimized Aurora Background (reduced blur & motion) ---------- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 15% 25%, rgba(124, 58, 237, 0.25), transparent 45%),
        radial-gradient(circle at 85% 20%, rgba(236, 72, 153, 0.22), transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(59, 130, 246, 0.22), transparent 50%),
        radial-gradient(circle at 30% 70%, rgba(245, 158, 11, 0.15), transparent 40%);
    filter: blur(20px); /* Reduced from 60px */
    animation: auroraFloat 25s ease-in-out infinite alternate; /* Slower animation */
    pointer-events: none;
    will-change: transform;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(7, 11, 20, 0.3); /* Removed backdrop-filter */
    pointer-events: none;
}

@keyframes auroraFloat {
    0% {
        background-position: 0% 50%;
        transform: scale(1);
    }
    50% {
        background-position: 100% 50%;
        transform: scale(1.02);
    }
    100% {
        background-position: 0% 50%;
        transform: scale(1);
    }
}

/* ---------- Floating Particles ---------- */
.particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -10%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: floatUp linear infinite;
    opacity: 0;
    will-change: transform, opacity;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-110vh) scale(1.5);
        opacity: 0;
    }
}

/* ---------- Main Container ---------- */
.container {
    width: 100%;
    max-width: 920px;
    background: rgba(15, 20, 35, 0.95); /* Solid enough to avoid backdrop blur */
    border-radius: var(--radius-xl);
    padding: 2.8rem;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border: 1px solid var(--surface-border);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Multi-layer gradient border */
.container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color), var(--secondary-color), var(--primary-color));
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderGlow 6s ease infinite;
    opacity: 0.7;
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Shimmering overlay */
.container::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.04) 50%, transparent 80%);
    transform: translateX(-100%);
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    55%, 100% { transform: translateX(100%); }
}

/* ---------- Header ---------- */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(130, 120, 255, 0.15);
    position: relative;
}

.mascot {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.2rem;
    position: relative;
}

.mascot::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-soft), transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: mascotPulse 3s ease-in-out infinite;
}

@keyframes mascotPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

.mascot img {
    display: block;
    width: 90px;
    height: 90px;
    transition: transform var(--transition-normal) var(--bounce);
    filter: drop-shadow(0 8px 20px rgba(139, 92, 246, 0.4));
}

.mascot img:hover {
    transform: scale(1.08) rotate(-6deg);
}

header h1 {
    font-size: 3.2rem;
    font-weight: 800;
    font-family: var(--font-display);
    background: linear-gradient(120deg, #c4b5fd, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.75rem;
    letter-spacing: -1px;
    text-shadow: none;
    position: relative;
    display: inline-block;
}

header h1::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--accent-color), transparent);
    border-radius: var(--radius-full);
    transform: translateX(-50%);
}

header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
    margin-top: 0.9rem;
    letter-spacing: 0.5px;
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    gap: 1rem;
    padding: 0.6rem;
    background: rgba(20, 25, 45, 0.6);
    border-radius: var(--radius-full);
    border: 1px solid rgba(130, 120, 255, 0.15);
    position: relative;
    backdrop-filter: blur(10px);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 2.2rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    position: relative;
    flex: 1;
    max-width: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    letter-spacing: 0.3px;
}

.tab-btn:hover {
    background: rgba(139, 92, 246, 0.12);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 8px 24px var(--primary-glow);
    transform: translateY(-2px);
}

.tab-btn.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: translateX(-100%);
    animation: tabShine 3s ease infinite;
}

@keyframes tabShine {
    0% { transform: translateX(-100%); }
    50%, 100% { transform: translateX(100%); }
}

.tab-btn .icon {
    font-size: 1.3rem;
}

/* ---------- Daily Highlights ---------- */
.daily-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.7s ease both;
}

.daily-card {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.12), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(130, 120, 255, 0.25);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition-normal) var(--bounce);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.daily-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15), transparent 70%);
    pointer-events: none;
}

.daily-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.3);
    border-color: rgba(167, 139, 250, 0.4);
}

.daily-card h3 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.daily-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.daily-content .reference {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.9rem;
    font-style: italic;
    opacity: 0.9;
}

.daily-content .word-title {
    font-weight: 700;
    color: var(--primary-hover);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.spinner.small {
    width: 26px;
    height: 26px;
    border-width: 3px;
    margin: 0 auto;
}

/* ---------- Form Elements ---------- */
select,
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 1.1rem 1.4rem;
    border: 2px solid var(--input-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-family: var(--font-sans);
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1.2em;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 0.3px;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23b0b8cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    padding-right: 3rem;
}

input[type="text"]::placeholder,
input[type="number"]::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.3px;
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 4px var(--input-focus), inset 0 2px 6px rgba(0,0,0,0.3);
    background-color: rgba(30, 35, 60, 0.9);
    transform: translateY(-1px);
}

/* Hide number spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* ---------- Buttons ---------- */
button[type="submit"] {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-normal) var(--bounce);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

button[type="submit"]:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 35px rgba(139, 92, 246, 0.5);
}

button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(139, 92, 246, 0.3);
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: 0.6s;
}

button[type="submit"]:hover::before {
    left: 100%;
}

/* Secondary button */
.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-hover);
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal) var(--bounce);
    letter-spacing: 0.4px;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 8px 25px var(--primary-glow);
    transform: translateY(-2px);
}

#load-more-container {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* ---------- Search Sections ---------- */
.search-section {
    margin-bottom: 3rem;
    animation: fadeInUp 0.5s ease both;
}

.search-section.hidden {
    display: none;
}

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

.search-section h2 {
    text-align: center;
    margin-bottom: 2.2rem;
    color: var(--text-primary);
    font-size: 1.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    letter-spacing: -0.3px;
}

.form-group {
    margin-bottom: 1.6rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.4rem;
    margin-bottom: 1.8rem;
}

/* ---------- Results Area ---------- */
#results {
    margin-top: 3rem;
    padding-top: 2.4rem;
    border-top: 1px solid rgba(130, 120, 255, 0.15);
    min-height: 220px;
    position: relative;
}

.placeholder {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 3.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    animation: fadeIn 0.6s ease;
}

.placeholder .icon {
    font-size: 3.5rem;
    opacity: 0.6;
    color: var(--primary-color);
    filter: drop-shadow(0 0 15px var(--primary-soft));
}

.loading-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
}

.spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    filter: drop-shadow(0 0 12px var(--primary-soft));
}

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

.error-message,
.no-results,
.success-message {
    text-align: center;
    font-size: 1.15rem;
    padding: 2.2rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    animation: fadeIn 0.4s ease;
}

.error-message {
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.success-message {
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.no-results {
    color: var(--text-muted);
    background: rgba(30, 35, 60, 0.7);
    border: 1px dashed rgba(130, 120, 255, 0.25);
}

/* ---------- Result Cards ---------- */
.result-item {
    background: linear-gradient(145deg, rgba(25, 30, 50, 0.9), rgba(15, 20, 35, 0.9));
    padding: 2.2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.8rem;
    border-left: 5px solid var(--primary-color);
    border-top: 1px solid rgba(130, 120, 255, 0.15);
    border-right: 1px solid rgba(130, 120, 255, 0.15);
    border-bottom: 1px solid rgba(130, 120, 255, 0.15);
    transition: all var(--transition-normal) var(--bounce);
    animation: slideUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(24px);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), transparent 50%, rgba(236, 72, 153, 0.05));
    pointer-events: none;
}

.result-item::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.12), transparent 70%);
    pointer-events: none;
}

.result-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.28);
    border-left-color: var(--accent-color);
}

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

.result-item h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.3px;
    position: relative;
    z-index: 1;
}

.result-item h3 .icon {
    color: var(--primary-hover);
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px var(--primary-soft));
}

.result-item .meta {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.4rem;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    z-index: 1;
}

.result-item .meta::before {
    content: '•';
    color: var(--secondary-color);
    font-weight: bold;
}

.result-item p.text,
.result-item .definition {
    font-size: 1.2rem;
    line-height: 1.85;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.result-item .example {
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 1.6rem;
    padding: 1.5rem;
    background: rgba(20, 25, 45, 0.6);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-color);
    position: relative;
    z-index: 1;
}

.result-item .example em {
    color: var(--accent-hover);
    font-weight: 500;
}

/* Word highlight in results */
.highlight {
    background: linear-gradient(120deg, rgba(245, 158, 11, 0.3), rgba(236, 72, 153, 0.25));
    padding: 0.12rem 0.4rem;
    border-radius: 6px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: rgba(20, 25, 45, 0.98);
    border: 1px solid rgba(130, 120, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(139, 92, 246, 0.2);
    pointer-events: auto;
    animation: toastIn 0.4s var(--bounce);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--error-color); }
.toast.info { border-left: 4px solid var(--info-color); }
.toast.warning { border-left: 4px solid var(--warning-color); }

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- Scroll to Top ---------- */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal) var(--bounce);
    z-index: 100;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.6);
    transform: translateY(-4px);
}

/* ---------- Accessibility ---------- */
*:focus-visible {
    outline: 3px solid var(--primary-hover);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--input-focus);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

::-webkit-scrollbar-track {
    background: rgba(20, 25, 45, 0.8);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-full);
    border: 2px solid rgba(20, 25, 45, 0.8);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--accent-hover));
}

/* ---------- Responsive Design ---------- */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .container {
        padding: 1.6rem;
        border-radius: var(--radius-lg);
    }

    header h1 {
        font-size: 2.4rem;
    }

    .tabs {
        flex-direction: column;
        gap: 0.75rem;
    }

    .tab-btn {
        max-width: 100%;
        padding: 0.95rem 1.6rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .result-item {
        padding: 1.8rem;
    }

    .result-item h3 {
        font-size: 1.5rem;
    }

    .daily-section {
        grid-template-columns: 1fr;
    }

    .scroll-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .tabs {
        padding: 0.4rem;
    }

    .tab-btn {
        font-size: 0.95rem;
        padding: 0.8rem 1rem;
    }

    .result-item {
        padding: 1.4rem;
        margin-bottom: 1rem;
    }

    .daily-card {
        padding: 1.5rem;
    }

    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }
}

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

    .particles,
    .particle {
        display: none !important;
    }

    body::before {
        animation: none;
        transform: none;
    }
}

/* ---------- Print Styles ---------- */
@media print {
    body {
        background: white;
        color: black;
    }

    .container {
        background: white;
        box-shadow: none;
        border: none;
    }

    button[type="submit"],
    .tabs,
    .scroll-top-btn,
    .toast-container {
        display: none;
    }
}