/* Base (shared) styles and tokens */
:root {
    --primary-color: #0A84FF;
    --secondary-color: #64D2FF;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --bg-primary: #F5F5F7;
    --bg-secondary: #E8E8ED;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --text-primary: #F5F5F7;
    --text-secondary: #A1A1A6;
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --glass-bg: rgba(30, 30, 30, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

/* Desktop dynamic gradient background */
.desktop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4f8df7 0%, #3b6eea 25%, #5271ff 50%, #4facfe 75%, #00c6ff 100%);
    background-size: 400% 400%;
    animation: gradientShift 22s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%
    }

    50% {
        background-position: 100% 50%
    }

    100% {
        background-position: 0% 50%
    }
}

/* Loader */
.loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 9999;
    transition: opacity .5s ease;
}

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

.loader-circle {
    width: 50px;
    height: 50px;
    border: 3px solid var(--bg-secondary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 40px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.06);
}

.theme-toggle i {
    font-size: 18px;
    color: var(--text-primary);
}

/* Toast notification */
.notification {
    position: fixed;
    top: 60px;
    right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 22px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    transform: translateX(400px);
    transition: transform .28s ease;
    z-index: 1001;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.notification-icon {
    font-size: 20px;
    color: var(--primary-color);
}

.notification-message {
    color: var(--text-primary);
    font-size: 14px;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}