/* Variables */
:root {
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --bg-color: #09090b;
    --sidebar-bg: #121217;
    --content-bg: #18181b;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --card-bg: #18181b;
    --input-bg: #27272a;
    --tab-active: #8b5cf6;
    --danger: #ef4444;
    --success: #22c55e;
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.3);
    --white: #ffffff;
    --black: #000000;
}

[data-theme="light"] {
    --border-color: rgba(0, 0, 0, 0.06);
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --content-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.12);
    --card-bg: #ffffff;
    --input-bg: #f1f5f9;
    --tab-active: #6366f1;
}

.hidden {
    display: none !important;
}

.modal-overlay {
    transition: opacity 0.5s ease;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
}

/* App Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 300px; /* Reduced slightly for better proportions */
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: relative;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), left 0.4s;
    z-index: 1200;
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    margin: 1rem -1rem;
    /* Negative margin to handle padding and scrollbar */
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.5) transparent; /* Modern browsers (Firefox) */
}

[data-theme="light"] .sidebar-content {
    scrollbar-color: var(--accent) transparent; /* Force Firefox/modern browser light mode scrollbar */
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background-color: rgba(139, 92, 246, 0.5); /* Explicit background-color property */
    border-radius: 10px;
    border: none;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
}

[data-theme="light"] .sidebar-content::-webkit-scrollbar-thumb {
    background-color: var(--accent); /* Very prominent solid color */
    border: none;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
    text-align: left;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--input-bg);
}

.tab-btn.active {
    color: var(--accent);
    background-color: var(--accent-glow);
    border: 1px solid var(--accent);
}

.tab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    transition: all 0.3s ease;
}

.tab-btn.active .tab-dot {
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Sidebar Segmentation Styles (Premium & Beautiful) */
.sidebar-segment {
    margin-bottom: 0.8rem;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .sidebar-segment {
    background: var(--card-bg);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.sidebar-segment.expanded {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.05) 0%, transparent 100%);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.1);
}

[data-theme="light"] .sidebar-segment.expanded {
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.08);
}

.segment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem;
    cursor: pointer;
    user-select: none;
    font-weight: 700;
    font-size: 0.95rem; /* Large and readable */
    letter-spacing: 0.5px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.segment-header:hover {
    background: rgba(139, 92, 246, 0.05);
}

[data-theme="light"] .segment-header:hover {
    background: rgba(99, 102, 241, 0.05);
}

.sidebar-segment.expanded .segment-header {
    color: var(--accent);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

[data-theme="light"] .sidebar-segment.expanded .segment-header {
    border-bottom-color: rgba(99, 102, 241, 0.1);
}

.segment-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

[data-theme="light"] .segment-icon {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-segment.expanded .segment-icon {
    transform: rotate(180deg);
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.4);
}

.segment-content {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-segment.expanded .segment-content {
    max-height: 800px;
    padding: 0.8rem;
}

/* Inner tab adjustments */
.sidebar-segment .tab-btn {
    border-radius: 10px;
    padding: 0.85rem 1.2rem;
    font-size: 0.95rem; /* Adjusted gracefully in context of segment */
}


.add-tab-btn {
    font-weight: 500;
}

.add-tab-btn {
    margin-top: 1rem;
    padding: 0.8rem;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.logout-btn:hover {
    opacity: 1;
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-bottom: 0.5rem;
}

[data-theme="light"] .theme-toggle {
    border-color: var(--border-color);
}

.theme-toggle:hover {
    background: var(--input-bg);
}

[data-theme="light"] .theme-toggle:hover {
    background: var(--input-bg);
}

/* Content Area */
.content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    position: relative;
}

.content-header {
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--sidebar-bg);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
}

.content-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viewport-container {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

#tab-iframe {
    width: 100%;
    height: 100%;
    border: none;
    transition: opacity 0.3s ease;
}

/* Login Overlay */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: var(--sidebar-bg);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.1);
    text-align: center;
    color: var(--text-primary);
}

.auth-card h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
}

.auth-input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: var(--input-bg);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

/* Admin Controls Styles */
.admin-tab-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.admin-btn.delete {
    background: var(--danger);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--sidebar-bg);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
}

/* Modal Helpers */
.modal-title {
    margin-bottom: 1.5rem;
}

.modal-form-group {
    margin-bottom: 1.5rem;
}

.modal-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.modal-input {
    margin-bottom: 0;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Helpers */
.user-display {
    font-weight: 500;
}

.copyright {
    font-size: 0.7rem;
    opacity: 0.5;
    margin-top: 1rem;
}

.auth-error-msg {
    color: var(--danger);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Watch Demo Button */
.watch-demo-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.2rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulseGlow 2s infinite;
}

.watch-demo-btn:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(139, 92, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

[data-theme="light"] .watch-demo-btn {
    background: rgba(124, 58, 237, 0.05);
    border-color: rgba(124, 58, 237, 0.2);
}

/* Landing Page Styles */
.landing-page {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    
    width: 100%;
    scroll-behavior: smooth;
}



.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* NAVBAR */
.landing-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-color);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0 24px;
}

[data-theme="light"] .landing-navbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.nav-inner {
    max-width: 1160px;
    margin: 0 auto;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.nav-logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* HERO */
.hero {
    padding: 100px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 20% 40%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 60%, rgba(139, 92, 246, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.hero h1 em {
    font-style: italic;
    color: var(--accent);
}

.hero-sub {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.btn-primary {
    padding: 1rem 2rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: 100px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 10px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px var(--accent-glow);
}

.btn-secondary {
    padding: 1rem 2rem;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-secondary);
    border-radius: 100px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    margin-left: 1rem;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Sections */
.landing-section {
    padding: 100px 0;
    scroll-margin-top: 100px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-weight: 700;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tool-card {
    padding: 2rem;
    background: var(--sidebar-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    transition: all 0.3s;
}

[data-theme="light"] .tool-card {
    border-color: rgba(0, 0, 0, 0.05);
}

.tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
.landing-footer {
    padding: 50px 24px;
    background: var(--sidebar-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

/* TOPBAR */
.topbar {
    background: var(--primary-gradient);
    padding: 8px 24px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Light Mode Overrides for Landing Page */
[data-theme="light"] .hero::before {
    background:
        radial-gradient(ellipse 70% 50% at 20% 40%, rgba(99, 102, 241, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 60%, rgba(139, 92, 246, 0.1) 0%, transparent 60%);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .btn-secondary {
        margin-left: 0;
        margin-top: 1rem;
        display: inline-block;
    }

    .price-card.featured {
        transform: none;
    }
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding-top: 2rem;
}

.price-card {
    padding: 3rem 2rem;
    background: var(--sidebar-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.price-card.featured {
    border: 2px solid var(--accent);
    transform: scale(1.05);
    z-index: 10;
}

.price-amount {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 1.5rem 0;
    line-height: 1;
}

.price-amount span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.price-features {
    list-style: none;
    margin-bottom: 2.5rem;
    text-align: left;
    width: 100%;
}

.price-features li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.price-features li::before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    padding: 6rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin: 4rem 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}
/* Mobile Specific Enhancements */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    width: 44px;
    height: 44px;
    z-index: 1300;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
transform: translateY(7px) rotate(15deg);
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1100;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed !important;
        left: -300px !important;
        top: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        width: 300px !important;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0 !important;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .content-area {
        width: 100%;
        max-width: 100vw;
    }

    .content-header {
        padding: 0.8rem 1rem;
    }
}

/* Tool Viewport Polish on Mobile */
@media (max-width: 600px) {
    .watch-demo-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .content-header h2 {
        font-size: 1rem;
        max-width: 150px;
    }

    .sidebar {
        width: 280px !important;
        left: -280px !important;
    }

    .logo {
        font-size: 1.5rem;
    }
}
