:root {
    /* Color Palette */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --dark: #0f172a;
    --dark-surface: rgba(30, 41, 59, 0.7);
    --light: #f8fafc;
    --light-surface: rgba(255, 255, 255, 0.7);
    --text-main: #334155;
    --text-muted: #64748b;
    --border: rgba(203, 213, 225, 0.5);
    
    /* Backgrounds */
    --bg-body: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.6);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --backdrop-blur: blur(12px);

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, var(--primary), var(--secondary));

    /* UI Measurements */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Stronger Shadows for Professional Look */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bg-glass: rgba(30, 41, 59, 0.65);
    --border: rgba(51, 65, 85, 0.5);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --primary: #818cf8;
}

html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative;
    max-width: 100vw;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 1.05rem;
    transition: var(--transition);
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

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

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.text-center { text-align: center; }
.mt-5 { margin-top: 3rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

/* Glassmorphism Elements */
.glass-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    width: 100%;
    z-index: 2000 !important;
    background: var(--bg-glass) !important;
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

@media (max-width: 800px) {
    .glass-nav {
        position: fixed !important;
        height: 70px;
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary);
}

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

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
}

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

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--primary);
    transform: rotate(15deg);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 2rem;
}

/* Layout */
.main-content {
    min-height: calc(100vh - 80px); /* Subtract nav */
    overflow-x: hidden;
    padding-top: 80px; /* Offset for fixed header */
}

@media (max-width: 800px) {
    .main-content {
        padding-top: 70px !important;
    }
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 1.5rem;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 4rem;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 1.2rem;
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 90%;
}

@media (max-width: 800px) {
    .hero-section {
        flex-direction: column;
        padding-top: 5rem;
    }
    .hero-title {
        font-size: 2.2rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    .hero-subtitle {
        text-align: center;
        max-width: 100%;
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    .hero-actions {
        justify-content: center;
        width: 100%;
    }
    .hero-badge {
        display: block;
        width: fit-content;
        margin: 0 auto 1.5rem;
    }
    .card-desc-long {
        display: none;
    }
    .section-container {
        padding: 2rem 1rem;
    }
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.hero-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: 10%;
    right: 10%;
    animation: float 6s ease-in-out infinite alternate;
}

.shape-2 {
    width: 250px;
    height: 250px;
    background: var(--secondary);
    bottom: 10%;
    left: 10%;
    animation: float 8s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-30px) scale(1.1); }
}

.hero-mockup {
    position: relative;
    z-index: 10;
    background: var(--bg-glass);
    transform: perspective(1000px) rotateY(-15deg) rotateX(5deg);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -20px 20px 60px rgba(0,0,0,0.1);
}

.hero-mockup:hover {
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg) translateY(-10px);
    box-shadow: -10px 30px 60px rgba(0,0,0,0.15);
}

.mockup-header {
    display: flex; gap: 8px; margin-bottom: 1.5rem;
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.chart-bars {
    display: flex; align-items: flex-end; gap: 15px; height: 160px; margin-top: 1.5rem;
}
.bar {
    flex: 1; background: rgba(99, 102, 241, 0.15); border-radius: 6px 6px 0 0;
    transition: var(--transition);
}
.bar:hover { filter: brightness(1.1); }
.bar.h-40 { height: 40%; animation: grow 1s ease-out; }
.bar.h-60 { height: 60%; animation: grow 1.2s ease-out; }
.bar.h-90 { height: 90%; animation: grow 1.4s ease-out; }
.bar.h-100 { height: 100%; animation: grow 1.6s ease-out; }
.bar.highlight { background: var(--gradient-brand); }

@keyframes grow {
    from { height: 0; }
}

/* Cards & Grids */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border);
    transition: var(--transition);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.premium-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.08);
}

[data-theme="dark"] .premium-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(30, 41, 59, 0.2));
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.card-icon.bg-gradient {
    background: var(--gradient-brand);
    color: white;
}

.card-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.card-content p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Tool Detail Page */
.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-interface {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.result-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-md);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    transition: var(--transition);
}

.result-box.has-content {
    background: rgba(16, 185, 129, 0.05); /* slightly green success */
    border-color: #10b981;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
}

#result-content {
    font-family: monospace;
    font-size: 1.25rem;
    word-break: break-all;
    margin-top: 1rem;
    color: var(--primary);
    font-weight: bold;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.tab-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active, .tab-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Footer */
.glass-footer {
    background: var(--bg-glass);
    border-top: 1px solid var(--border);
    padding: 4rem 1.5rem 2rem;
    margin-top: 4rem;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.socials {
    display: flex;
    gap: 1rem;
}

.socials a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
}

.socials a:hover {
    background: var(--primary);
    color: white;
}

.footer-links a, .footer-contact p {
    display: block;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 800px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-actions {
        justify-content: center;
    }
}

@media (max-width: 800px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-glass);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2.5rem 1.5rem;
        gap: 2rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        text-align: center;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links a {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-main);
    }
    .mobile-menu-btn {
        display: block;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 60px;
    height: 60px;
    background: var(--gradient-brand);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 9999 !important;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    border: none;
    pointer-events: auto;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

@media (max-width: 600px) {
    .back-to-top {
        bottom: 2rem;
        right: 1.5rem;
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
        display: flex !important;
        visibility: hidden; /* JavaScript will make it visible */
    }
    .back-to-top.visible {
        visibility: visible !important;
        opacity: 1 !important;
    }
}
