:root {
    /* Primary Colors - Orange/Amber Theme */
    --primary-gradient: linear-gradient(135deg, #ec9213 0%, #f5a623 100%);
    --secondary-gradient: linear-gradient(135deg, #ffc107 0%, #f5a623 100%);
    --success-gradient: linear-gradient(135deg, #ec9213 0%, #f5a623 100%);
    --accent-gradient: linear-gradient(135deg, #ec9213 0%, #ffc107 100%);

    /* Background Colors - Warm Dark Theme */
    --bg-primary: #221a10;
    --bg-secondary: #2a2218;
    --bg-card: #2a2218;
    --bg-card-hover: #3a3028;

    /* Light Mode Backgrounds */
    --bg-light: #f8f7f6;
    --bg-light-card: #ffffff;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #c9b8a0;
    --text-muted: #897961;
    --text-dark: #181511;

    /* Accent Colors - Orange Palette */
    --accent-orange: #ec9213;
    --accent-amber: #f5a623;
    --accent-gold: #ffc107;
    --accent-green: #10b981;

    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(236, 146, 19, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100dvh;
    overflow-y: auto;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-orange);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-amber);
}

/* --- Shared Refactored Components --- */

/* Navigation Bar */
.nav-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 4px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
}

.dark .nav-container {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

.nav-item {
    position: relative !important;
    z-index: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 48px !important;
    width: 25% !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nav-item.active .nav-icon,
.nav-item.active .nav-label {
    color: white !important;
    opacity: 1 !important;
}

.nav-pill {
    position: absolute !important;
    top: 4px !important;
    bottom: 4px !important;
    width: calc(25% - 8px) !important;
    background: #ec9213 !important;
    border-radius: 50px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1 !important;
    box-shadow: 0 4px 12px rgba(236, 146, 19, 0.3) !important;
}

/* Floating Header Pill */
.header-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 6px 4px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Very subtle shadow */
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    overflow: hidden;
}

.dark .header-container {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    /* Slightly darker for visibility in dark mode */
}

/* Service Cards - List View (Default) */
.service-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 1.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.dark .service-card {
    background: rgba(42, 34, 24, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.service-card:hover {
    border-color: rgba(236, 146, 19, 0.3) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.dark .service-card:hover {
    background: rgba(42, 34, 24, 0.8) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

.service-card:active {
    transform: scale(0.98) !important;
    background: rgba(236, 146, 19, 0.08) !important;
    border-color: rgba(236, 146, 19, 0.4) !important;
}

/* Service Cards - Grid View */
.services-grid.grid-view {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
}

.services-grid.grid-view .service-card {
    flex-direction: column !important;
    padding: 1.25rem !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.dark .services-grid.grid-view .service-card {
    background: rgba(42, 34, 24, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.services-grid.grid-view .service-card>div:first-child {
    flex-direction: column !important;
    gap: 0.75rem !important;
}

.services-grid.grid-view .service-card .size-14 {
    width: 3.5rem !important;
    height: 3.5rem !important;
    margin: 0 auto !important;
}

.services-grid.grid-view .service-card h3 {
    font-size: 0.875rem !important;
}

.services-grid.grid-view .service-card p {
    font-size: 8px !important;
}

.services-grid.grid-view .service-card>div:last-child {
    display: none !important;
}

/* Empty State - Always Centered in Both Views */
.services-grid.grid-view .empty-state {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

/* Layout Toggle Button */
.layout-toggle {
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.dark .layout-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.layout-toggle:hover {
    background: rgba(236, 146, 19, 0.1);
    border-color: rgba(236, 146, 19, 0.3);
}

.layout-toggle:active {
    transform: scale(0.95);
}

.layout-toggle.active {
    background: rgba(236, 146, 19, 0.15);
    border-color: rgba(236, 146, 19, 0.4);
}

.layout-toggle .material-symbols-outlined {
    color: #847864;
    transition: color 0.2s ease;
}

.layout-toggle:hover .material-symbols-outlined,
.layout-toggle.active .material-symbols-outlined {
    color: #ec9213;
}

/* Modals & Overlays */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Daily Bonus Styles */
#daily-bonus-modal.show {
    display: block;
}

#daily-bonus-modal.show #bonus-content {
    transform: translateY(0);
}

#bonus-content {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reward Cards - Match Reference UI */
.reward-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}

.reward-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 12px 16px 12px;
    min-height: 120px;
    border-radius: 1.25rem;
    background: #1e2531 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: all 0.3s ease;
    overflow: hidden;
}

.reward-card.col-span-2 {
    grid-column: span 2 / span 2;
}

/* Active / Claimable State */
.reward-card[data-status="available"] {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
    cursor: pointer;
}

.reward-card[data-status="available"]:active {
    transform: scale(0.97);
}

.reward-card-day {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.02em;
}

.reward-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.reward-card-amount {
    font-size: 15px;
    font-weight: 800;
    color: white;
    font-family: 'Outfit', sans-serif;
}

/* Weekly Bonus Progress Card */
.weekly-progress-card {
    background: #1e2531;
    border-radius: 1.5rem;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.weekly-icon-box {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: #2d3748;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a855f7);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Big Claim Button */
.btn-claim-main {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, #7c3aed, #a855f7);
    border-radius: 1.25rem;
    color: white;
    font-weight: 900;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3);
    transition: all 0.2s ease;
}

.btn-claim-main:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* Overlays */
.reward-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.4);
    z-index: 5;
}

.reward-card-overlay.claimed {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(1px);
}

/* Pulse Animation for Available */
@keyframes pulse-slow {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.animate-pulse-slow {
    animation: pulse-slow 2s ease-in-out infinite;
}

/* Shine Effect Animation */
.shine-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 100%;
    }
}

/* Bounce Animation for Available Reward */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Claim Success Modal */
.claim-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.claim-modal.hidden {
    display: none;
}

.claim-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.claim-modal-content {
    position: relative;
    background: linear-gradient(180deg, rgba(30, 41, 59, 1) 0%, rgba(15, 23, 42, 1) 100%);
    width: 100%;
    max-width: 24rem;
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: modalZoomIn 0.3s ease-out;
}

@keyframes modalZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.claim-modal-emoji {
    position: absolute;
    top: -3rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4.5rem;
}

/* --- Legacy Styles (kept for backwards compatibility) --- */
.reward-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.dark .reward-circle {
    background: #2a2218;
    border-color: rgba(255, 255, 255, 0.05);
}

.reward-item.claimed .reward-circle {
    background: rgba(236, 146, 19, 0.1);
    border-color: #ec9213;
}

.reward-item.locked .reward-circle {
    opacity: 0.6;
}

.reward-item.claimed .reward-circle::after {
    content: 'check_circle';
    font-family: 'Material Symbols Outlined';
    position: absolute;
    color: #ec9213;
    font-size: 28px;
    font-variation-settings: 'FILL' 1;
}

/* Profile Modal */
#profile-modal.show {
    display: block;
}

#profile-modal.show #profile-content {
    transform: translateY(0);
}

#profile-content {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Notification Modal */
.notification-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 360px;
    background: rgba(42, 34, 24, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 24px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* Generator Detail Cards */
.details-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.copy-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #ec9213;
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 900;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Animations */
@keyframes pulse-border {
    0% {
        border-color: rgba(236, 146, 19, 0.2);
    }

    50% {
        border-color: rgba(236, 146, 19, 0.6);
    }

    100% {
        border-color: rgba(236, 146, 19, 0.2);
    }
}

@keyframes pulse-soft {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tap-scale {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.92);
    }

    100% {
        transform: scale(1);
    }
}

.pulse-soft {
    animation: pulse-soft 2s infinite;
}

.spin-slow {
    animation: spin 3s linear infinite;
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.nav-tap {
    animation: tap-scale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}