/* TikTok Ads Simulator — SaaS styles */

.sim-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 0 64px;
}

@media (max-width: 900px) {
    .sim-container { grid-template-columns: 1fr; }
}

.sim-sidebar {
    background: var(--bg-surface, #18181b);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    height: fit-content;
}

.sim-step {
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary, #a1a1aa);
    font-weight: 500;
    font-size: 0.8125rem;
    transition: background 150ms, color 150ms;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
}

.sim-step:hover {
    background: var(--bg-hover, #27272a);
    color: var(--text-primary, #fafafa);
}

.sim-step.active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-secondary, #818cf8);
    border-left-color: var(--accent-primary, #6366f1);
}

.sim-step i {
    width: 18px;
    text-align: center;
    font-size: 0.75rem;
}

.sim-content {
    background: var(--bg-surface, #18181b);
    border-radius: 12px;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    padding: 24px;
    min-height: 480px;
    position: relative;
}

.sim-header {
    border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.sim-header h2,
.sim-header h3 {
    margin: 0;
    color: var(--text-primary, #fafafa);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sim-header h2 i,
.sim-header h3 i {
    color: var(--accent-primary, #6366f1);
}

.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    color: var(--text-primary, #fafafa);
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 6px;
}

.form-label.highlight,
.sim-sidebar .form-label.highlight {
    color: var(--accent-secondary, #818cf8);
}

.form-sublabel {
    display: block;
    color: var(--text-tertiary, #71717a);
    font-size: 0.75rem;
    margin-bottom: 6px;
}

.result-box {
    background: var(--bg-primary, #09090b);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-secondary, #a1a1aa);
    font-family: ui-monospace, monospace;
    font-size: 0.8125rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copy-icon {
    color: var(--accent-primary, #6366f1);
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 150ms;
}

.copy-icon:hover {
    opacity: 1;
    transform: none;
}

.audience-list {
    background: var(--bg-primary, #09090b);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    overflow: hidden;
}

.audience-list.highlight-border {
    border-color: rgba(99, 102, 241, 0.25) !important;
    padding: 10px;
}

.audience-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
}

.audience-item:last-child { border-bottom: none; }

.audience-label {
    color: var(--text-tertiary, #71717a);
    font-size: 0.8125rem;
    width: 140px;
}

.audience-value {
    color: var(--text-primary, #fafafa);
    font-weight: 500;
    font-size: 0.8125rem;
    flex: 1;
}

.tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-secondary, #818cf8);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin: 0 4px 4px 0;
    display: inline-block;
    cursor: pointer;
    transition: background 150ms;
}

.tag:hover {
    background: rgba(99, 102, 241, 0.16);
    transform: none;
}

.sim-highlight {
    color: var(--accent-secondary, #818cf8);
    font-weight: 600;
}

.d-none { display: none !important; }

.upload-wrapper {
    border: 2px dashed var(--border-secondary, rgba(255, 255, 255, 0.12));
    border-radius: 10px;
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    position: relative;
    background: var(--bg-primary, #09090b);
    transition: border-color 150ms, background 150ms;
}

.upload-wrapper:hover {
    border-color: var(--border-secondary, rgba(255, 255, 255, 0.12));
    background: var(--bg-hover, #27272a);
}

.upload-wrapper.drag-active {
    border-color: var(--accent-primary, #6366f1);
    background: rgba(99, 102, 241, 0.04);
}

.close-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: #fff;
    border: 2px solid var(--bg-surface, #18181b);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: opacity 150ms;
    font-size: 0.75rem;
}

.close-btn:hover { opacity: 0.9; transform: none; }

.sim-generate-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: var(--accent-primary, #6366f1);
    color: #fff;
}

.sim-generate-btn:hover {
    background: #5558e3;
}

/* Page layout */
.sim-page-header {
    margin-bottom: 20px;
}

.sim-page-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.sim-page-header h2 i {
    color: var(--accent-primary, #6366f1);
    margin-right: 8px;
}

.sim-page-desc {
    color: var(--text-secondary, #a1a1aa);
    font-size: 0.875rem;
}

.sim-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-surface, #18181b);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    margin-bottom: 16px;
}

.sim-tabs .tab-btn {
    flex: 1;
    border: none;
    padding: 8px 12px;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8125rem;
    background: transparent;
    color: var(--text-secondary, #a1a1aa);
}

.sim-tabs .tab-btn.active {
    background: var(--bg-hover, #27272a);
    color: var(--text-primary, #fafafa);
}

.sim-input-wrap {
    position: relative;
}

.sim-input-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary, #71717a);
}

.sim-input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    background: var(--bg-primary, #09090b);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    color: var(--text-primary, #fafafa);
    outline: none;
    font-size: 0.875rem;
}

.sim-input:focus {
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.sim-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary, #09090b);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    color: var(--text-primary, #fafafa);
    outline: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.sim-textarea {
    width: 100%;
    height: 100px;
    background: var(--bg-primary, #09090b);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    color: var(--text-secondary, #a1a1aa);
    padding: 10px;
    resize: none;
    font-size: 0.8125rem;
    font-family: inherit;
}

.sim-copy-btn {
    margin-top: 8px;
    background: var(--bg-hover, #27272a);
    color: var(--text-primary, #fafafa);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
}

.sim-copy-btn:hover {
    background: var(--bg-elevated, #1f1f23);
}

.sim-hook-box {
    border-left: 3px solid #ff0050 !important;
}

.sim-hook-text {
    font-weight: 600;
    font-style: italic;
}

.sim-results {
    margin-bottom: 100px;
}

.upload-icon {
    font-size: 2rem;
    color: var(--text-tertiary, #71717a);
    margin-bottom: 8px;
}

.upload-text {
    color: var(--text-secondary, #a1a1aa);
    margin: 0;
    font-size: 0.875rem;
}

.preview-wrap {
    position: relative;
    display: inline-block;
}

.preview-wrap img {
    max-height: 220px;
    border-radius: 8px;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
}

.audience-block {
    display: block;
    padding: 4px 0;
    border: none !important;
}

.audience-block .audience-label {
    display: block;
    margin-bottom: 4px;
}

.audience-divider {
    border: none;
    border-top: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    opacity: 0.6;
    margin: 4px 0;
}

.form-group-spaced { margin-top: 16px; }

.footer-spaced { margin-top: 20px; }

.tag-copied {
    background: var(--accent-primary, #6366f1) !important;
    color: #fff !important;
    border-color: var(--accent-primary, #6366f1) !important;
}
