/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.6s ease, color 0.6s ease;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== CSS CUSTOM PROPERTIES (defaults / aurora theme) ===== */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(15, 15, 40, 0.7);
    --bg-card-hover: rgba(20, 20, 55, 0.85);
    --text-primary: #e8e8f0;
    --text-secondary: #9090b0;
    --text-muted: #606080;
    --accent-1: #00e68a;
    --accent-2: #7b5cf5;
    --accent-3: #00b4d8;
    --border-card: rgba(123, 92, 245, 0.25);
    --border-card-hover: rgba(0, 230, 138, 0.5);
    --glow-color: rgba(0, 230, 138, 0.15);
    --card-radius: 20px;
    --header-bg: rgba(10, 10, 26, 0.8);
    --font-heading: 'Inter', sans-serif;
    --shadow-card: 0 4px 30px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 40px rgba(123, 92, 245, 0.2);
    --lock-bg: rgba(10, 10, 26, 0.85);
    --lock-text: #9090b0;
    --status-active-bg: rgba(0, 230, 138, 0.15);
    --status-active-color: #00e68a;
    --status-locked-bg: rgba(144, 144, 176, 0.1);
    --status-locked-color: #606080;
    --btn-bg: var(--accent-1);
    --btn-color: #0a0a1a;
    --footer-text: #606080;
}

/* ===== BACKGROUND ELEMENTS ===== */
.stars {
    position: fixed;
    inset: 0;
    z-index: -3;
    opacity: 0;
    transition: opacity 0.8s ease;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 65%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 50% 10%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 75%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 15% 80%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 90%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 15%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 40% 50%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.5) 0%, transparent 100%);
}

.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    transition: opacity 0.8s ease;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    transition: all 1s ease;
}

.blob-1 {
    width: 500px;
    height: 500px;
    top: -10%;
    left: -5%;
    background: var(--accent-2);
    animation: float-1 12s ease-in-out infinite;
}

.blob-2 {
    width: 400px;
    height: 400px;
    top: 50%;
    right: -10%;
    background: var(--accent-1);
    animation: float-2 15s ease-in-out infinite;
}

.blob-3 {
    width: 350px;
    height: 350px;
    bottom: -5%;
    left: 30%;
    background: var(--accent-3);
    animation: float-3 18s ease-in-out infinite;
}

@keyframes float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, 40px) scale(1.1); }
    66% { transform: translate(-30px, 80px) scale(0.95); }
}

@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, -30px) scale(1.05); }
    66% { transform: translate(40px, -60px) scale(0.9); }
}

@keyframes float-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.08); }
    66% { transform: translate(-60px, 20px) scale(0.92); }
}

/* ===== HEADER ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-card);
    transition: background 0.6s ease, border-color 0.6s ease;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-1);
    transition: color 0.6s ease;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    transition: color 0.6s ease;
}

.logo-accent {
    color: var(--accent-1);
    transition: color 0.6s ease;
}

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    transition: color 0.6s ease;
}

.theme-buttons {
    display: flex;
    gap: 8px;
}

.theme-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

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

.theme-btn.active {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

.theme-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: block;
}

.theme-btn[data-theme="dark-futuristic"] .theme-dot {
    background: linear-gradient(135deg, #0ff, #f0f);
}

.theme-btn[data-theme="glass"] .theme-dot {
    background: linear-gradient(135deg, #a855f7, #3b82f6, #ec4899);
}

.theme-btn[data-theme="aurora"] .theme-dot {
    background: linear-gradient(135deg, #00e68a, #7b5cf5, #00b4d8);
}

.theme-btn[data-theme="minimal"] .theme-dot {
    background: linear-gradient(135deg, #f97316, #8b5cf6);
}

/* ===== HERO ===== */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px 40px;
    text-align: center;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    transition: color 0.6s ease;
}

.hero-highlight {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    transition: color 0.6s ease;
}

/* ===== TOOLS GRID ===== */
.tools-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* ===== TOOL CARD ===== */
.tool-card {
    position: relative;
    border-radius: var(--card-radius);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: card-enter 0.6s ease backwards;
    animation-delay: calc(var(--i) * 0.1s);
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-inner {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--card-radius);
    padding: 28px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: background 0.6s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Unlocked card hover */
.tool-card.unlocked:hover {
    transform: translateY(-6px);
}

.tool-card.unlocked:hover .card-inner {
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-card-hover);
    background: var(--bg-card-hover);
}

/* Locked card */
.tool-card.locked {
    cursor: not-allowed;
}

.tool-card.locked .card-inner {
    opacity: 0.55;
}

.tool-card.locked:hover .card-inner {
    opacity: 0.65;
}

/* Lock overlay */
.lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--lock-bg);
    border-radius: var(--card-radius);
    opacity: 0;
    transition: opacity 0.3s ease;
    gap: 8px;
}

.tool-card.locked:hover .lock-overlay {
    opacity: 1;
}

.lock-icon {
    width: 36px;
    height: 36px;
    color: var(--lock-text);
    animation: lock-bounce 0.5s ease;
}

.lock-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--lock-text);
    letter-spacing: 0.03em;
}

@keyframes lock-bounce {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(2px); }
}

/* Card icon */
.card-icon {
    width: 52px;
    height: 52px;
    color: var(--accent-1);
    transition: color 0.6s ease;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

/* Card content */
.card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    transition: color 0.6s ease;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: color 0.6s ease;
}

.card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-card);
    transition: border-color 0.6s ease;
}

/* Status badges */
.card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.6s ease;
}

.status-active {
    background: var(--status-active-bg);
    color: var(--status-active-color);
}

.status-locked {
    background: var(--status-locked-bg);
    color: var(--status-locked-color);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-active .status-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Button */
.card-btn {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 12px;
    background: var(--btn-bg);
    color: var(--btn-color);
    transition: all 0.3s ease;
    letter-spacing: 0.01em;
}

.card-btn:hover {
    filter: brightness(1.15);
    transform: translateX(3px);
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--footer-text);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-card);
    transition: all 0.6s ease;
}

/* =========================================================
   THEME 1: DARK FUTURISTIC
   ========================================================= */
[data-theme="dark-futuristic"] {
    --bg-primary: #050510;
    --bg-secondary: #0a0a1f;
    --bg-card: rgba(10, 10, 35, 0.9);
    --bg-card-hover: rgba(15, 15, 50, 0.95);
    --text-primary: #e0e0ff;
    --text-secondary: #8080b0;
    --text-muted: #505078;
    --accent-1: #0ff;
    --accent-2: #f0f;
    --accent-3: #0af;
    --border-card: rgba(0, 255, 255, 0.12);
    --border-card-hover: rgba(0, 255, 255, 0.5);
    --glow-color: rgba(0, 255, 255, 0.1);
    --card-radius: 8px;
    --header-bg: rgba(5, 5, 16, 0.9);
    --font-heading: 'JetBrains Mono', monospace;
    --shadow-card: 0 0 20px rgba(0, 255, 255, 0.05);
    --shadow-card-hover: 0 0 40px rgba(0, 255, 255, 0.15), 0 0 80px rgba(255, 0, 255, 0.08);
    --lock-bg: rgba(5, 5, 16, 0.92);
    --lock-text: #505078;
    --status-active-bg: rgba(0, 255, 255, 0.1);
    --status-active-color: #0ff;
    --status-locked-bg: rgba(80, 80, 120, 0.1);
    --status-locked-color: #505078;
    --btn-bg: transparent;
    --btn-color: #0ff;
    --footer-text: #505078;
}

[data-theme="dark-futuristic"] body {
    background: #050510;
    color: #e0e0ff;
}

[data-theme="dark-futuristic"] .stars {
    opacity: 0;
}

[data-theme="dark-futuristic"] .bg-blobs {
    opacity: 0.3;
}

[data-theme="dark-futuristic"] .blob-1 { background: #0ff; }
[data-theme="dark-futuristic"] .blob-2 { background: #f0f; }
[data-theme="dark-futuristic"] .blob-3 { background: #0af; }

[data-theme="dark-futuristic"] .card-inner {
    border: 1px solid rgba(0, 255, 255, 0.12);
    background:
        linear-gradient(var(--bg-card), var(--bg-card)),
        linear-gradient(135deg, rgba(0,255,255,0.03) 0%, transparent 50%);
}

[data-theme="dark-futuristic"] .card-btn {
    border: 1px solid #0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

[data-theme="dark-futuristic"] .card-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

[data-theme="dark-futuristic"] .tool-card.unlocked:hover .card-inner {
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.15), 0 0 80px rgba(255, 0, 255, 0.08), inset 0 0 30px rgba(0, 255, 255, 0.03);
}

/* Scan line effect */
[data-theme="dark-futuristic"] .card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #0ff, transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

[data-theme="dark-futuristic"] .tool-card.unlocked:hover .card-inner::before {
    opacity: 0.6;
    animation: scanline 2s linear infinite;
}

@keyframes scanline {
    0% { top: 0; }
    100% { top: 100%; }
}

/* =========================================================
   THEME 2: GLASSMORPHISM
   ========================================================= */
[data-theme="glass"] {
    --bg-primary: #1a0533;
    --bg-secondary: #1a0533;
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(255, 255, 255, 0.14);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent-1: #a855f7;
    --accent-2: #3b82f6;
    --accent-3: #ec4899;
    --border-card: rgba(255, 255, 255, 0.15);
    --border-card-hover: rgba(255, 255, 255, 0.3);
    --glow-color: rgba(168, 85, 247, 0.15);
    --card-radius: 24px;
    --header-bg: rgba(255, 255, 255, 0.06);
    --font-heading: 'Inter', sans-serif;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 16px 48px rgba(168, 85, 247, 0.2);
    --lock-bg: rgba(26, 5, 51, 0.8);
    --lock-text: rgba(255, 255, 255, 0.5);
    --status-active-bg: rgba(168, 85, 247, 0.2);
    --status-active-color: #c084fc;
    --status-locked-bg: rgba(255, 255, 255, 0.05);
    --status-locked-color: rgba(255, 255, 255, 0.35);
    --btn-bg: rgba(168, 85, 247, 0.9);
    --btn-color: #fff;
    --footer-text: rgba(255, 255, 255, 0.35);
}

[data-theme="glass"] body {
    background: linear-gradient(135deg, #1a0533 0%, #0f172a 30%, #1e1b4b 60%, #4a0e4e 100%);
    color: #ffffff;
}

[data-theme="glass"] .stars {
    opacity: 0;
}

[data-theme="glass"] .bg-blobs {
    opacity: 0.5;
}

[data-theme="glass"] .blob-1 { background: #a855f7; filter: blur(100px); }
[data-theme="glass"] .blob-2 { background: #3b82f6; filter: blur(100px); }
[data-theme="glass"] .blob-3 { background: #ec4899; filter: blur(100px); }

[data-theme="glass"] .card-inner {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="glass"] .tool-card.unlocked:hover .card-inner {
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    background: rgba(255, 255, 255, 0.14);
}

[data-theme="glass"] .header {
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

/* =========================================================
   THEME 3: AURORA BOREALE (default)
   ========================================================= */
[data-theme="aurora"] body {
    background: #0a0a1a;
    color: #e8e8f0;
}

[data-theme="aurora"] .stars {
    opacity: 1;
}

[data-theme="aurora"] .bg-blobs {
    opacity: 0.35;
}

[data-theme="aurora"] .blob-1 { background: #7b5cf5; filter: blur(90px); }
[data-theme="aurora"] .blob-2 { background: #00e68a; filter: blur(90px); }
[data-theme="aurora"] .blob-3 { background: #00b4d8; filter: blur(90px); }

[data-theme="aurora"] .card-inner {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Iridescent border on hover */
[data-theme="aurora"] .tool-card.unlocked:hover .card-inner {
    border-image: linear-gradient(135deg, #00e68a, #7b5cf5, #00b4d8, #00e68a) 1;
    border-image-slice: 1;
}

/* Override border-image with a pseudo-element for rounded corners */
[data-theme="aurora"] .tool-card.unlocked::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--card-radius);
    padding: 1px;
    background: linear-gradient(135deg, #00e68a, #7b5cf5, #00b4d8, #00e68a);
    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;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: shimmer 4s ease infinite;
}

[data-theme="aurora"] .tool-card.unlocked:hover::before {
    opacity: 1;
}

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

/* Aurora wave in background */
[data-theme="aurora"]::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 40%;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(0, 230, 138, 0.03) 30%,
        rgba(123, 92, 245, 0.05) 60%,
        rgba(0, 180, 216, 0.03) 100%
    );
    z-index: -1;
    animation: aurora-wave 10s ease-in-out infinite alternate;
}

@keyframes aurora-wave {
    0% { transform: translateX(-5%) skewY(-1deg); }
    100% { transform: translateX(5%) skewY(1deg); }
}

/* =========================================================
   THEME 4: MINIMALISTE CLAIR
   ========================================================= */
[data-theme="minimal"] {
    --bg-primary: #fafaf9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #a0a0a0;
    --accent-1: #f97316;
    --accent-2: #8b5cf6;
    --accent-3: #f97316;
    --border-card: #e5e5e5;
    --border-card-hover: #f97316;
    --glow-color: transparent;
    --card-radius: 16px;
    --header-bg: rgba(250, 250, 249, 0.9);
    --font-heading: 'Inter', sans-serif;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.1);
    --lock-bg: rgba(250, 250, 249, 0.92);
    --lock-text: #a0a0a0;
    --status-active-bg: rgba(249, 115, 22, 0.1);
    --status-active-color: #ea580c;
    --status-locked-bg: #f5f5f4;
    --status-locked-color: #a0a0a0;
    --btn-bg: #1a1a1a;
    --btn-color: #ffffff;
    --footer-text: #a0a0a0;
}

[data-theme="minimal"] body {
    background: #fafaf9;
    color: #1a1a1a;
}

[data-theme="minimal"] .stars {
    opacity: 0;
}

[data-theme="minimal"] .bg-blobs {
    opacity: 0;
}

[data-theme="minimal"] .card-inner {
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="minimal"] .tool-card.unlocked:hover .card-inner {
    border-color: #f97316;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="minimal"] .hero-highlight {
    background: linear-gradient(135deg, #f97316, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="minimal"] .header {
    border-bottom: 1px solid #e5e5e5;
}

[data-theme="minimal"] .card-btn {
    border-radius: 10px;
}

[data-theme="minimal"] .card-btn:hover {
    background: #f97316;
}

[data-theme="minimal"] .lock-overlay {
    background: rgba(250, 250, 249, 0.92);
}

[data-theme="minimal"] .tool-card.locked .card-inner {
    opacity: 0.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero {
        padding: 60px 20px 30px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        padding: 30px 20px 60px;
    }

    .header-inner {
        flex-direction: column;
        gap: 12px;
    }

    .theme-switcher {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
}
