:root {
    --primary: #9d00ff;
    /* Electric Purple */
    --primary-hover: #b538ff;
    --text-on-primary: #fff;
    --bg-dark: #030005;
    /* Deepest Purple/Black */
    --bg-sidebar: #080010;
    --bg-card: #0e0518;
    --glass-border: #2a1535;
    --text-main: #ffffff;
    --text-muted: #a090b0;
    --error: #ff3333;
    --glow-primary: 0 0 20px rgba(157, 0, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 10% 20%, rgba(100, 0, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(157, 0, 255, 0.05) 0%, transparent 40%);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 1000;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    letter-spacing: -0.5px;
    color: #fff;
}

.brand span {
    color: var(--primary);
}

.nav-group {
    margin-bottom: 2rem;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    letter-spacing: 1px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(157, 0, 255, 0.1);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(157, 0, 255, 0.1);
}

.nav-item i {
    width: 20px;
}

/* ... existing classes ... */
/* NOTE: Replaced content via tool to maintain context, skipping intermediate lines */
/* For brevity, I am targeting specific blocks. Let's do the tool-card hover too. */
/* Wait, I cannot skip lines in ReplacementContent for replace_file_content unless I target a block. 
   I will target the nav-item block first. */

.nav-item i {
    width: 20px;
}

.user-section {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: var(--primary);
    border-radius: 50%;
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-email {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem 3rem;
    max-width: 1400px;
}

/* Top Bar (Mobile / Actions) */
.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.credits-pill {
    background: #111;
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.auth-btn {
    background: #fff;
    /* Dark btn usually, but let's make it pop */
    color: #000;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.auth-btn:hover {
    background: #e0e0e0;
}

/* Dashboard Grid (Home View) */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
    margin-top: 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero-title span {
    color: var(--primary);
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.3s, border-color 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.tool-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Generator Views (Auth / Tools) */
.card-panel {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Forms */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    background: #000;
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.primary-btn {
    width: 100%;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn:hover {
    background: var(--primary-hover);
}

/* Auth Page specific override */
body.auth-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

/* Notifications (Custom Toast) */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #111;
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast.error {
    border-color: var(--error);
}

.toast i {
    font-size: 1.2rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-bottom: 80px;
        /* Space for bottom nav */
    }

    .tools-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    .hero-title {
        font-size: 2rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }
}

/* Mobile Bottom Nav */
.mobile-nav {
    display: none;
}

@media (max-width: 900px) {
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(8, 0, 16, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--glass-border);
        justify-content: space-around;
        padding: 1rem 0.5rem;
        z-index: 1000;
        align-items: center;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    }

    .mobile-nav a {
        color: var(--text-muted);
        font-size: 1.2rem;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        transition: all 0.2s;
    }

    .mobile-nav a.active {
        color: var(--primary);
        background: rgba(157, 0, 255, 0.1);
        box-shadow: 0 0 10px rgba(157, 0, 255, 0.2);
    }
}

.hidden {
    display: none !important;
}

.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Result Area */
.generated-image-container img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

/* Tool Layouts */
.qr-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {

    .qr-layout,
    .controls-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .preview {
        margin-top: 1rem;
    }
}