/* Paste this at the top of your CSS file */

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden; 
}

/* ... keep the rest of your existing CSS code below this ... */


:root {
    --bg-main: #030712; 
    --accent: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-muted: #94a3b8;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    background: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto; 
    height: 100vh;
    width: 100%;
}

/* --- HD Liquid Background with Gooey Physics --- */
.background-canvas {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #0f172a, #030712);
    overflow: hidden;
    filter: url(#gooey-physics); 
}

.background-canvas::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.15;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.7;
    mix-blend-mode: screen;
    will-change: transform;
}

.b1 { width: 650px; height: 650px; background: radial-gradient(circle, #4338ca, transparent); top: -10%; left: 5%; }
.b2 { width: 550px; height: 550px; background: radial-gradient(circle, #6366f1, transparent); bottom: -5%; right: 10%; }
.b3 { width: 450px; height: 450px; background: radial-gradient(circle, #a855f7, transparent); top: 30%; left: 35%; opacity: 0.4; }

/* --- Particle System --- */
#particle-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* --- Fixed Magnetic Navigation --- */
.floating-nav {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    z-index: 100;
}

.nav-brand {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    cursor: default;
    will-change: transform;
}

.nav-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* --- Viewport & Layout --- */
.viewport {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.main-heading { 
    font-size: 4.5rem; 
    font-weight: 800; 
    letter-spacing: -3px; 
    margin: 0;
    text-align: center;
}

.main-heading span { 
    background: linear-gradient(to right, #7c8cff, #c6a0eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sub-heading { 
    color: var(--text-muted); 
    margin-top: 10px; 
    font-size: 1.1rem; 
    text-align: center;
}

/* --- Glass Hub --- */
.glass-hub {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(60px) saturate(180%);
    -webkit-backdrop-filter: blur(60px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 50px;
    width: 100%;
    max-width: 420px;
    margin-top: 40px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
    position: relative;
    box-sizing: border-box;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.glass-hub.hidden {
    display: none !important;
    opacity: 0;
}

.glass-hub.visible-override {
    opacity: 1 !important;
}

.pulse-icon {
    width: 85px;
    height: 85px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 20px;
    transition: transform 0.3s ease, background 0.3s;
}

.drop-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    margin-bottom: 30px;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.drop-trigger:hover {
    border-color: var(--accent);
    background: rgba(129, 140, 248, 0.05);
}

.drop-trigger.drag-active {
    border: 2px solid var(--accent);
    background: rgba(129, 140, 248, 0.1);
    box-shadow: 0 0 30px rgba(129, 140, 248, 0.3);
    transform: scale(1.02);
}

.drop-trigger.drag-active .pulse-icon {
    transform: scale(1.1);
    background: var(--accent);
    color: white;
}

.drop-trigger.drag-active span {
    color: var(--accent);
    letter-spacing: 3px;
}

/* --- Inputs --- */
.input-glow-group { position: relative; margin-bottom: 15px; }

.input-glow-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
}

input {
    width: 100%;
    padding: 18px 20px 18px 55px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff !important;
    font-size: 1rem;
    box-sizing: border-box;
    transition: 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    background: rgba(255, 255, 255, 0.08);
}

.btn-glow-primary {
    width: 100%;
    padding: 20px;
    border-radius: 18px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.4);
    position: relative;
    overflow: hidden;
    transition: 0.3s;
}

.btn-glow-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.6);
}

.btn-glow-primary:active {
    transform: scale(0.98);
}

/* --- Results --- */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.85); 
    backdrop-filter: blur(8px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 40px;
    gap: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(129, 140, 248, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    box-shadow: 0 0 20px var(--accent-glow);
}

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

.result-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    animation: fadeIn 0.5s ease;
}

.result-view h3{
    margin-bottom: 10px;
}
.success-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.4);
}

/* === NEW CAUTION BOX STYLES === */
.caution-box {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 12px 15px;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 12px;
    color: #facc15;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    text-align: left;
}
.caution-box i { font-size: 1.1rem; flex-shrink: 0; }

.code-display-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

#generated-code {
    font-family: 'Courier New', monospace;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
    word-break: break-all;
}

#copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 10px;
}

#copy-btn:hover { color: white; transform: scale(1.1); }

/* --- Toast --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent);
    color: white;
    padding: 18px 25px;
    border-radius: 14px;
    min-width: 320px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-left-color: #4ade80; }
.toast.success i { color: #4ade80; }
.toast.error { border-left-color: #f87171; }
.toast.error i { color: #f87171; }

.hidden { display: none !important; opacity: 0 !important; }

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

/* ========================================= */
/* === FIXED TOUR SYSTEM STYLES (Performance) === */
/* ========================================= */

#tour-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.9); /* Darker to obscure main app */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    transition: opacity 0.5s ease;
}

/* This is the Highlighted Button (Plus Icon) */
.tour-focus-element {
    position: relative;
    z-index: 10010 !important; 
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6), 0 0 0 2px rgba(99, 102, 241, 1) !important;
    background-color: #0f172a !important; 
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* The Container (Nav Bar or Card) */
.tour-elevated-parent {
    z-index: 10005 !important;
    transition: none;
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(30px) !important;
    border: 1px solid var(--glass-border) !important;
    opacity: 1 !important; /* Force visible during tour */
}

/* --- MOBILE SPECIFIC FIX --- */
@media (max-width: 768px) {
    .floating-nav.tour-elevated-parent {
        position: fixed !important;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        bottom: 20px !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        height: auto !important;
        flex-direction: row !important; 
        padding: 12px 25px !important;
        border-radius: 50px !important;
        display: flex !important;
    }
}

/* --- DESKTOP SPECIFIC FIX --- */
@media (min-width: 769px) {
    .floating-nav.tour-elevated-parent {
        position: fixed !important;
        left: 30px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: auto !important;
        max-width: 80px !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 20px 12px !important;
        border-radius: 30px !important;
    }
}

.glass-hub.tour-elevated-parent {
    position: relative !important;
}

/* Tour Overlay Layers */
#active-tour-layer {
    position: fixed;
    inset: 0;
    z-index: 10000; 
    pointer-events: none;
}

#tour-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10001; 
}

#tour-connector {
    stroke: #818cf8;
    stroke-width: 2px;
    stroke-dasharray: 6;
    animation: dash 60s linear infinite;
    filter: drop-shadow(0 0 5px #818cf8);
}

#tour-anchor {
    fill: #818cf8;
    filter: drop-shadow(0 0 8px #818cf8);
    z-index: -1;
}

/* --- PERFORMANCE FIX FOR TOOLTIP --- */
.tour-tooltip {
    position: absolute;
    top: 0; 
    left: 0;
    margin: 0;
    transform: translate3d(0,0,0); /* Force GPU */
    will-change: transform, opacity;

    max-width: 300px;
    width: 90%; 
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #818cf8;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    padding: 25px;
    border-radius: 24px;
    color: white;
    z-index: 10050; 
    opacity: 0;
    pointer-events: auto;
    box-sizing: border-box; 
}

.tour-tooltip h3 { margin: 0 0 10px 0; color: #818cf8; font-size: 1.2rem; }
.tour-tooltip p { color: #94a3b8; line-height: 1.6; margin-bottom: 20px; }

.tour-controls {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px;
}

#tour-next-btn {
    background: #818cf8; border: none; padding: 8px 18px;
    border-radius: 8px; color: white; font-weight: 600; cursor: pointer;
}

/* Modal */
.tour-modal-overlay {
    position: fixed; inset: 0; z-index: 10060;
    display: flex; align-items: center; justify-content: center;
    background: transparent; /* Backdrop handles the bg */
}

.tour-welcome-card {
    background: #0f172a; 
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 30px; 
    padding: 40px; 
    text-align: center; 
    max-width: 400px;
    margin: 0 20px;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6), 0 0 0 2px rgba(99, 102, 241, 1);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* NEW CLASS FOR SKIP BUTTON */
.tour-action-btn {
    width: auto;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s;
}
.tour-action-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.tour-welcome-card p { color: var(--accent); }

@keyframes dash { to { stroke-dashoffset: 1000; } }

/* ========================================= */
/* === RESPONSIVE MEDIA QUERIES === */
/* ========================================= */

@media (max-width: 768px) {
    .floating-nav {
        left: 50%;
        top: auto;
        bottom: 20px;
        transform: translateX(-50%) !important;
        flex-direction: row;
        width: auto;
        padding: 12px 25px;
        border-radius: 50px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .nav-brand { display: none; }
    .viewport {
        padding: 80px 15px 120px 15px; 
        justify-content: flex-start; 
    }
    .main-heading { font-size: 3rem; }
    .glass-hub { padding: 30px; margin-top: 25px; }
    .drop-trigger { padding: 25px; }
    .pulse-icon { width: 60px; height: 60px; font-size: 1.5rem; }
    #generated-code { font-size: 1.5rem; letter-spacing: 3px; }
    #toast-container {
        top: auto; bottom: 100px; right: 50%;
        transform: translateX(50%); width: 90%; align-items: center;
    }
    .toast { min-width: auto; width: 100%; box-sizing: border-box; }
    input { font-size: 16px; }
    .b1, .b2, .b3 { transform: scale(0.6); }
}

@media (max-height: 700px) {
    .viewport { padding-top: 40px; }
    .main-heading { font-size: 2.5rem; }
}