:root {
    /* Base Settings */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --container-max: 1200px;
    --header-height: 70px;

    /* DEFAULT THEME (Dark Glass) */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --primary: #6366f1;
    /* Indigo */
    --primary-hover: #4f46e5;
    --secondary: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-indigo: #818cf8;

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-hover: rgba(255, 255, 255, 0.08);

    --bg-gradient:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 20%);
}

[data-theme="cyberpunk"] {
    --bg-primary: #050505;
    --text-main: #00ff41;
    --text-muted: #008f11;

    --primary: #f700ff;
    /* Neon Pink */
    --primary-hover: #d500dc;
    --secondary: #00efff;
    /* Cyan */
    --accent-green: #00ff41;
    --accent-red: #ff003c;
    --accent-indigo: #bc13fe;

    --glass-bg: rgba(0, 0, 0, 0.7);
    --glass-border: 1px solid #00efff;
    --glass-hover: rgba(247, 0, 255, 0.1);

    --bg-gradient:
        linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000),
        linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000);
}

[data-theme="sunset"] {
    --bg-primary: #2d1b2e;
    --text-main: #ffecd1;
    --text-muted: #ffb7b2;

    --primary: #ff6e40;
    /* Orange */
    --primary-hover: #f4511e;
    --secondary: #ff9e80;
    --accent-green: #00bfa5;
    --accent-red: #ff3d00;
    --accent-indigo: #d81b60;

    --glass-bg: rgba(255, 87, 34, 0.1);
    --glass-border: 1px solid rgba(255, 110, 64, 0.3);
    --glass-hover: rgba(255, 87, 34, 0.2);

    --bg-gradient:
        linear-gradient(180deg, #2d1b2e 0%, #b04632 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Mobile fix */
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    /* Parallax feel */
    background-size: cover;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.5s ease, color 0.5s ease;
    /* Safe area for mobile devices (notches/home bars) */
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

/* Staggered animation delays for lists */
.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

.card:nth-child(4) {
    animation-delay: 0.4s;
}


/* Typography & Links */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.875rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    color: var(--text-muted);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Layout */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 20px;
}

/* Nav */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* standard prop */
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Components */
.card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    backdrop-filter: blur(5px);
    /* Default animation */
    animation: slideUp 0.6s ease-out backwards;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

input,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

/* Chat UI */
.chat-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.chat-toggle:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

.chat-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-left: var(--glass-border);
    transition: right 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.chat-sidebar.open {
    right: 0;
}

.chat-header {
    padding: 1.5rem;
    border-bottom: var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    align-self: flex-start;
}

.chat-message.own {
    align-self: flex-end;
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

.chat-user {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--primary);
}

.chat-message.own .chat-user {
    color: var(--accent-indigo);
}

.chat-content {
    font-size: 0.95rem;
    word-break: break-word;
}

.chat-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-align: right;
}

.chat-input-area {
    padding: 1rem;
    border-top: var(--glass-border);
    display: flex;
    gap: 0.5rem;
}

/* Coloring Utilities */
.text-success {
    color: var(--accent-green) !important;
}

.text-danger {
    color: var(--accent-red) !important;
}

.text-white {
    color: #fff !important;
}

/* Theme Toggles */
.theme-options {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--glass-bg);
    border: var(--glass-border);
    padding: 10px;
    border-radius: 50px;
    display: flex;
    gap: 10px;
    backdrop-filter: blur(10px);
    z-index: 9999;
}

.theme-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.theme-btn:hover {
    transform: scale(1.2);
}

.theme-btn.active {
    border-color: var(--text-main);
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .mobile-stack {
        flex-direction: column;
    }

    .nav {
        padding: 1rem;
    }

    .mobile-hidden {
        display: none;
    }

    .chat-sidebar {
        width: 100%;
        right: -100%;
    }
}