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

:root {
    --bg-primary: #fafbfc;
    --bg-secondary: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --border-color: #e5e7eb;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --shadow-sm: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --nav-bg: rgba(30, 41, 59, 0.95);
    --shadow-sm: rgba(0, 0, 0, 0.3);
}

html, body {
    }

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 14px 0;
    box-shadow: 0 1px 3px var(--shadow-sm);
    transition: all 0.3s ease;
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-logo {
    height: 42px;
    width: auto;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.navbar-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link:hover {
    background: var(--bg-primary);
    color: #6366f1;
}

.nav-link.active {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.125rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-toggle:hover {
    background: var(--bg-primary);
    color: #6366f1;
    border-color: #6366f1;
}

.theme-icon {
    width: 18px;
    height: 18px;
}

/* Share Dropdown in Navbar */
.share-dropdown {
    position: relative;
}

.share-toggle {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    border: 1.5px solid #06b6d4;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: #06b6d4;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.share-toggle:hover {
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);
}

.share-toggle svg {
    transition: all 0.2s ease;
}

.share-toggle:hover svg {
    filter: brightness(0) invert(1);
}

.share-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.02);
    min-width: 160px;
    z-index: 1001;
    padding: 6px;
}

.share-dropdown-menu.active {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: left;
}

.share-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.share-dropdown-item svg {
    flex-shrink: 0;
}

[data-theme="dark"] .share-dropdown-menu {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
}


.nav-cta {
    background: linear-gradient(135deg, #ff6b35 0%, #f59e0b 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.35), 0 1px 3px rgba(255, 107, 53, 0.25);
    flex-shrink: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.45), 0 3px 8px rgba(255, 107, 53, 0.3);
    filter: brightness(1.05);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    background: var(--bg-primary);
    color: #6366f1;
    border-color: #6366f1;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.service-header {
    padding: 25px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-bottom: 2px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
}

.header-logo {
    height: 60px;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1));
}

.header-text {
    text-align: left;
}

.service-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.service-header p {
    margin: 5px 0 0 0;
    font-size: 1rem;
    color: #4b5563;
    font-weight: 500;
}

/* Split Screen Layout */
.app-container {
    display: flex;
    flex: 1;
    width: 100%;
    margin: 72px 0 0 0;
    gap: 0;
}

/* Control Groups Navigation Sidebar */
.control-groups-nav {
    width: 70px;
    background: #2d3748;
    border-right: 2px solid #1a202c;
    display: flex;
    flex-direction: column;
        margin-top: 0;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 0;
    gap: 8px;
    overflow-y: auto;
    flex-shrink: 0;
}

.group-tab {
    width: 60px;
    height: 100px;
    display: flex;
    flex-direction: column;
        margin-top: 0;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    margin: 4px 0;
    padding: 12px 8px;
}

.group-tab i {
    font-size: 22px;
}

.group-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.group-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.group-tab.active {
    background: #5e72e4;
    color: white;
}

/* Scrollbar styling for control groups nav */
.control-groups-nav::-webkit-scrollbar {
    width: 6px;
}

.control-groups-nav::-webkit-scrollbar-track {
    background: transparent;
}

.control-groups-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.control-groups-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Left Panel - Controls */
.controls-panel {
    width: 340px;
    background: white;
    border-right: 2px solid #e5e7eb;
    overflow-y: auto;
    padding: 0;
}

.control-group {
    padding: 25px 20px;
}

.group-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.control-row {
    margin-bottom: 12px;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    display: block;
    font-weight: 500;
}

.control-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: white;
}

.control-input:focus {
    outline: none;
    border-color: #5e72e4;
    box-shadow: 0 0 0 2px rgba(94, 114, 228, 0.1);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    height: 5px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #5e72e4;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #5e72e4;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.slider-value {
    min-width: 48px;
    text-align: center;
    font-size: 11px;
    color: #374151;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.toggle-container {
    display: flex;
    align-items: center;
}

.toggle-input {
    display: none;
}

.toggle-label {
    width: 48px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-label::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-input:checked + .toggle-label {
    background: #5e72e4;
}

.toggle-input:checked + .toggle-label::after {
    transform: translateX(24px);
}

.input-with-color {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-color .control-input {
    flex: 1;
}

.input-with-color .color-swatch {
    width: 32px;
    height: 32px;
}

.color-picker-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 5px;
    border: 2px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.color-swatch:hover {
    transform: scale(1.05);
    border-color: #5e72e4;
}

.color-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.export-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: white;
    color: #374151;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.export-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.export-btn.primary {
    background: #5e72e4;
    color: white;
    border-color: #5e72e4;
}

.export-btn.primary:hover {
    background: #4c63d2;
}

.export-btn i {
    font-size: 12px;
}

.export-btn.full-width {
    width: 100%;
}

/* Right Panel - Result */
.result-panel {
    flex: 1;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow: auto;
}

.result-container {
    display: flex;
    flex-direction: column;
        margin-top: 0;
    gap: 20px;
}

/* Comparison Card Styling */
.comparison-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 500px;
    max-width: 700px;
    display: flex;
    flex-direction: column;
        margin-top: 0;
    gap: 30px;
    position: relative;
    overflow: hidden;
}


.card-top {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.card-section {
    flex: 1;
    display: flex;
    flex-direction: column;
        margin-top: 0;
    gap: 8px;
    position: relative;
}

.card-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.card-value {
    font-size: 40px;
    font-weight: 700;
    color: #374151;
    line-height: 1;
}


.card-divider {
    width: 2px;
    background: #d1d5db;
    align-self: stretch;
    margin: 0 10px;
}

.card-bottom {
    display: flex;
    flex-direction: column;
        margin-top: 0;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.growth-percent {
    font-size: 48px;
    font-weight: 700;
    color: #22c55e;
    line-height: 1;
}

.growth-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.chart-info {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
}

.info-label {
    color: #6b7280;
    font-weight: 500;
}

.info-value {
    color: #374151;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Color Picker Popover */
.color-picker-popover {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 1000;
    min-width: 280px;
}

.color-picker-popover.active {
    display: block;
}

.color-picker-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.color-picker-popover-title {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.color-picker-close {
    cursor: pointer;
    color: #9ca3af;
    font-size: 18px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.color-picker-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.preset-colors-label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-colors {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.preset-color {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-color:hover {
    transform: scale(1.1);
    border-color: #5e72e4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Preset Colors Grid */
.preset-colors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.preset-color-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.preset-color-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-color: rgba(94, 114, 228, 0.5);
}

/* Footer */
.app-footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 15px 20px;
    text-align: center;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.app-info {
    font-weight: 500;
    color: #374151;
}

.separator {
    color: #d1d5db;
}

.free-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


.privacy-link {
    background: none;
    border: none;
    color: #5e72e4;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.2s ease;
}

.privacy-link:hover {
    color: #4c63d2;
}

/* Privacy Modal */
.privacy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow: auto;
    padding: 20px;
}

.privacy-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.privacy-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.privacy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #e5e7eb;
}

.privacy-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.privacy-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.privacy-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.privacy-modal-body {
    padding: 30px;
    color: #374151;
    line-height: 1.6;
}

.privacy-modal-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-top: 25px;
    margin-bottom: 12px;
}

.privacy-modal-body h3:first-of-type {
    margin-top: 0;
}

.privacy-modal-body p {
    margin-bottom: 15px;
    font-size: 14px;
}

.privacy-modal-body ul {
    margin: 15px 0;
    padding-left: 25px;
}

.privacy-modal-body li {
    margin-bottom: 8px;
    font-size: 14px;
}

.privacy-modal-body a {
    color: #5e72e4;
    text-decoration: none;
    font-weight: 500;
}

.privacy-modal-body a:hover {
    text-decoration: underline;
}

.privacy-updated {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 20px;
}


/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .control-groups-nav {
        width: 100%;
        height: 70px;
        flex-direction: row;
        justify-content: flex-start;
        border-right: none;
        border-bottom: 2px solid #1a202c;
        padding: 0 15px;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 12px;
    }

    .group-tab {
        height: 60px;
        width: 80px;
        margin: 0;
    }

    .group-label {
        writing-mode: horizontal-tb;
        font-size: 10px;
    }

    .controls-panel {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #e5e7eb;
        max-height: none;
    }

    .result-panel {
        width: 100%;
        padding: 30px 20px;
    }

    .comparison-card {
        padding: 30px;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    
    html, body {
        padding-top: 0px;
    }

    .navbar {
        padding: 10px 0;
    }

    .navbar-container {
        gap: 12px;
        position: relative;
    }

    .navbar-brand {
        flex: 1;
    }

    .navbar-logo {
        height: 32px;
        width: auto;
    }
    .mobile-menu-btn {
        display: flex;
    }

    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 24px;
        width: auto;
        min-width: 160px;
        flex-direction: column;
        gap: 0;
        padding: 6px;
        background: var(--nav-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-top: 8px;
        box-shadow: 0 4px 12px var(--shadow-sm);
    }

    .navbar-nav.active {
        display: flex;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.875rem;
        text-align: left;
        border-radius: 4px;
        white-space: nowrap;
    }

    .theme-toggle {
        padding: 6px 10px;
    }

    .share-toggle {
        padding: 8px 12px;
        font-size: 0.8125rem;
        background: #06b6d4;
        color: white;
        border-color: #06b6d4;
    }

    .share-toggle span {
        display: none;
    }

    .share-toggle svg {
        filter: brightness(0) invert(1);
        width: 18px;
        height: 18px;
    }


    .nav-cta {
        display: none;
    }


.header-content {
        flex-direction: column;
        
        padding-top: 52px;
        gap: 15px;
    }

    .header-logo {
        height: 50px;
    }

    .service-header h1 {
        font-size: 1.5rem;
    }

    .control-groups-nav {
        padding: 0 10px;
        height: 65px;
        gap: 8px;
    }

    .group-tab {
        width: 70px;
    }

    .control-group {
        padding: 20px 15px;
    }

    .comparison-card {
        padding: 25px;
        max-width: 100%;
    }

    .card-value {
        font-size: 32px;
    }

    .growth-percent {
        font-size: 36px;
    }
}
