@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #09090b;
    --surface-color: #18181b;
    --border-color: #27272a;
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent-color: #10b981;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --glass-bg: rgba(24, 24, 27, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex; /* Sidebar Layout */
    overflow-x: hidden;
}

/* Sidebar Wrapper */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    padding: 32px 20px;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 48px;
    padding-left: 10px;
}

.sidebar-logo i {
    font-size: 24px;
    color: var(--primary-color);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0 10px;
}

.lang-btn {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.user-info {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.app-main {
    flex-grow: 1;
    margin-left: 260px; /* Offset for sidebar */
    padding: 60px;
    max-width: 1200px;
}

/* Auth Overlay */
#authOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-premium);
    animation: slideUp 0.4s ease-out;
}

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

.auth-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-tab.active {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

/* Tables & Lists */
.campaign-list {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.campaign-row {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    cursor: pointer;
}

.campaign-row:hover {
    border-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.03);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-active { background: rgba(16, 185, 129, 0.1); color: var(--accent-color); }
.status-paused { background: rgba(113, 113, 122, 0.1); color: var(--text-secondary); }

/* Custom: Wizard & Content adjustment */
.container {
    max-width: 900px;
    margin: 0; /* Align with sidebar grid */
    padding: 0;
}


/* Header */
header {
    text-align: center;
    margin-bottom: 60px;
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.logo-text {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to bottom, #fff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
}

/* Wizard Progress */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
    transform: translateY(-50%);
}

.progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

.progress-step.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.progress-step.completed {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Form Card */
.wizard-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px;
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

.wizard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
}

.step-content {
    display: none;
    animation: slideIn 0.4s ease-out;
}

.step-content.active {
    display: block;
}

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

h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-desc {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 15px;
}

/* Inputs */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

input, select, textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Navigation Buttons */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 16px;
}

button {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.btn-pulse {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #3f3f46;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Analysis Overlay */
.analysis-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loader {
    width: 64px;
    height: 64px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

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

.analysis-text {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Results Styles */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Creatives Grid */
.creatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.metric-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.metric-val {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
}

.metric-lab {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Copy Box */
.copy-area {
    background: #000;
    border-radius: 12px;
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #a1a1aa;
    margin: 16px 0;
    border: 1px solid var(--border-color);
    position: relative;
}

.copy-area::after {
    content: 'COPY';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 10px;
    color: var(--text-muted);
}

/* New: Tooltips & Info */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--border-color);
    border-radius: 50%;
    font-size: 10px;
    color: var(--text-secondary);
    cursor: help;
    margin-left: 6px;
    vertical-align: middle;
}

.info-box {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.info-box strong { color: var(--primary-color); }

/* New: Help Modal/Sections */
.setup-guide {
    display: none;
    animation: fadeIn 0.3s ease;
}

.setup-guide.active {
    display: block;
}

.guide-step {
    border-left: 2px solid var(--primary-color);
    padding-left: 20px;
    margin-bottom: 30px;
}

.guide-step h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

/* Footer & Legal */
footer {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
}

.legal-notice {
    font-size: 11px;
    max-width: 800px;
    margin: 20px auto 0;
    line-height: 1.5;
}

/* Tabs for UI Mode */
.wizard-nav-top {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    justify-content: center;
}

.tab-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

/* Optimizer Table */
.opt-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.opt-table th, .opt-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 14px;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-good { background: var(--accent-color); }
.status-warning { background: var(--warning-color); }
.status-bad { background: var(--danger-color); }

/* Pricing Styles */
.pricing-container {
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-top: 40px;
}

.pricing-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
}

.pricing-card.featured {
    border-color: #fbbf24;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.1);
    transform: scale(1.05);
}

.pro-tag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

.price {
    font-size: 48px;
    font-weight: 800;
    margin: 24px 0;
}

.price span {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    margin-bottom: 32px;
    flex-grow: 1;
}

.pricing-features li {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.pricing-features li i {
    width: 18px;
    height: 18px;
    color: var(--accent-color);
}

.pricing-features li.disabled {
    color: var(--text-muted);
    opacity: 0.5;
}

.pricing-features li.disabled i {
    color: var(--danger-color);
}

/* Tooltip Styles */
.help-icon {
    display: inline-flex;
    cursor: pointer;
    color: var(--primary-color);
    opacity: 0.7;
    margin-left: 6px;
    vertical-align: middle;
}

.help-icon:hover {
    opacity: 1;
}

/* Paywall Overlay */
.paywall-lock {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

@media (max-width: 768px) {
    body { flex-direction: column; overflow-x: hidden; }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        padding: 10px 15px;
        flex-direction: row;
        z-index: 1000;
        border-right: none;
        border-top: 1px solid var(--border-color);
        justify-content: space-around;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(10px);
    }

    .sidebar-logo, .lang-switcher, .user-info, .logo-text { display: none; }
    
    .nav-links { 
        display: flex; 
        flex-direction: row; 
        width: 100%; 
        justify-content: space-around; 
        margin-top: 0;
    }

    .nav-item {
        flex-direction: column;
        gap: 4px;
        font-size: 10px;
        padding: 8px;
        text-align: center;
    }

    .nav-item i { margin-right: 0; width: 20px; height: 20px; }

    .app-main {
        margin-left: 0;
        padding: 20px 20px 100px 20px; /* Space for bottom nav */
    }

    .pricing-grid { grid-template-columns: 1fr; gap: 24px; }
    .grid-2 { grid-template-columns: 1fr; }
    .wizard-card { padding: 24px 16px; border-radius: 20px; }
    h1 { font-size: 24px; }
}

