/* ==========================================================================
   GetAppRank.com — Luxury Dark-Mode ASO & Rank Tracking Design System
   ========================================================================== */

:root {
    --bg-base: #080c14;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #1e293b;
    --bg-surface-glass: rgba(15, 23, 42, 0.75);
    
    --border-subtle: #1e293b;
    --border-light: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(99, 102, 241, 0.35);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --color-primary: #6366f1; /* Indigo */
    --color-primary-hover: #4f46e5;
    --color-primary-glow: rgba(99, 102, 241, 0.25);

    --color-cyan: #06b6d4;
    --color-cyan-glow: rgba(6, 182, 212, 0.2);

    --color-emerald: #10b981; /* Rank gain */
    --color-emerald-glow: rgba(16, 185, 129, 0.2);

    --color-rose: #f43f5e; /* Rank drop */
    --color-rose-glow: rgba(244, 63, 94, 0.2);

    --color-amber: #f59e0b; /* Warnings / Radar */
    --color-amber-glow: rgba(245, 158, 11, 0.2);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px var(--color-primary-glow);
}

/* Light Theme Variables */
:root[data-theme="light"], [data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-surface-glass: rgba(255, 255, 255, 0.88);
    
    --border-subtle: #e2e8f0;
    --border-light: rgba(0, 0, 0, 0.08);
    --border-accent: rgba(79, 70, 229, 0.25);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-glow: rgba(79, 70, 229, 0.12);

    --color-cyan: #0284c7;
    --color-cyan-glow: rgba(2, 132, 199, 0.12);

    --color-emerald: #059669;
    --color-emerald-glow: rgba(5, 150, 105, 0.12);

    --color-rose: #e11d48;
    --color-rose-glow: rgba(225, 29, 72, 0.12);

    --color-amber: #d97706;
    --color-amber-glow: rgba(217, 119, 6, 0.12);

    --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.1);
}

.theme-icon.hidden {
    display: none !important;
}

body, .glass-card, .top-nav, .sidebar, .modal-dialog, .form-input, .kpi-card, .competitor-card, .goldmine-card {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* ==========================================================================
   Top Navigation
   ========================================================================== */

.top-nav {
    height: 72px;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-right: 12px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-cyan));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 15px var(--color-primary-glow);
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.brand-tld {
    color: var(--color-cyan);
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 800;
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-primary);
    border: 1px solid var(--border-accent);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    margin-left: 4px;
}

.app-selector-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-base);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.selector-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.app-dropdown {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
.app-dropdown option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.country-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 6px 12px;
}

.country-dropdown {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
}
.country-dropdown option {
    background: var(--bg-surface);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #4f46e5);
    color: #fff;
    box-shadow: 0 4px 14px var(--color-primary-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--color-primary-glow);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--border-light);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}
.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}

/* ==========================================================================
   Layout & Sidebar
   ========================================================================== */

.app-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 72px);
}

.sidebar {
    width: 260px;
    background: var(--bg-surface-glass);
    border-right: 1px solid var(--border-subtle);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
}

.nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

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

.nav-item.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.12);
    border-left: 3px solid var(--color-primary);
    font-weight: 600;
}

.tab-badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
}

.alert-glow {
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-amber);
    animation: pulseGlow 2s infinite;
}

.goldmine-badge {
    background: rgba(6, 182, 212, 0.2);
    color: var(--color-cyan);
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.sidebar-footer {
    margin-top: 24px;
}

.plan-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.9));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.plan-badge {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.plan-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.plan-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 4px 0 10px;
}

.plan-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-emerald);
}

/* ==========================================================================
   Main Content Views
   ========================================================================== */

.main-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    max-width: 1400px;
}

.tab-view {
    display: none;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-view.active {
    display: block;
}

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

.view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 20px;
}

.view-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.view-subtitle {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-top: 4px;
}

.active-app-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
}

.app-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.banner-app-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.banner-app-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   KPI Cards Grid
   ========================================================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-card);
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-accent);
}

.kpi-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-indigo { background: rgba(99, 102, 241, 0.15); color: var(--color-primary); }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: var(--color-cyan); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--color-emerald); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); }

.kpi-value {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ==========================================================================
   Glass Cards & Grids
   ========================================================================== */

.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.two-col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.text-emerald { color: var(--color-emerald); }
.text-rose { color: var(--color-rose); }
.text-amber { color: var(--color-amber); }
.text-indigo { color: var(--color-primary); }
.text-cyan { color: var(--color-cyan); }

.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ==========================================================================
   Climbers & Fallers Lists
   ========================================================================== */

.climbers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.climber-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.climber-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.climber-kw {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.climber-app {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rank-pill {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.rank-gain {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.rank-loss {
    background: rgba(244, 63, 94, 0.15);
    color: var(--color-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 14px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.kw-cell {
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-cell {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.competitor-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.competitor-thumb {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* SVG Sparklines */
.sparkline-svg {
    width: 120px;
    height: 32px;
    overflow: visible;
}

.sparkline-path {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sparkline-fill {
    fill: url(#sparkGradient);
    opacity: 0.2;
}

/* ==========================================================================
   Competitor Radar & Changelog
   ========================================================================== */

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

.competitor-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}
.competitor-card:hover {
    border-color: var(--border-accent);
}

.comp-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.comp-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.comp-name {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.comp-meta-row {
    background: var(--bg-base);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-bottom: 8px;
    font-size: 0.82rem;
}

.comp-meta-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.comp-meta-val {
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding-left: 8px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 36px;
    bottom: -16px;
    width: 2px;
    background: var(--border-subtle);
}
.timeline-item:last-child::before {
    display: none;
}

.timeline-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-amber);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #000;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 4px;
}

.timeline-content {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    flex: 1;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.timeline-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.diff-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
    margin-top: 6px;
}

.diff-old {
    color: var(--color-rose);
    background: rgba(244, 63, 94, 0.08);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.diff-new {
    color: var(--color-emerald);
    background: rgba(16, 185, 129, 0.08);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Keyword Gap Finder
   ========================================================================== */

.goldmine-card {
    border-color: rgba(6, 182, 212, 0.35);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(15, 23, 42, 0.9));
}

.goldmine-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.goldmine-icon {
    font-size: 2rem;
}

.goldmine-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.goldmine-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.goldmine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.goldmine-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.gm-word {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-cyan);
}

.gm-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.gm-action {
    font-size: 0.78rem;
    color: var(--color-emerald);
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   ASO Health Grader
   ========================================================================== */

.gauge-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 16px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: var(--bg-surface-elevated);
    stroke-width: 10;
}

.gauge-bar {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease, stroke 0.5s ease;
}

.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-score {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.gauge-grade {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-emerald);
    letter-spacing: 0.05em;
}

.aso-tier-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.aso-tier-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.meter-box {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.meter-name { color: #fff; }
.meter-count { color: var(--color-primary); }

.meter-bar-track {
    height: 8px;
    background: var(--bg-surface-elevated);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.meter-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-cyan));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.meter-sample {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    word-break: break-all;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rec-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-base);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.88rem;
    color: var(--text-primary);
}

/* ==========================================================================
   Review Sentiment & Pain Points
   ========================================================================== */

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

.takeaway-card {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.takeaway-type {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-amber);
    margin-bottom: 6px;
}

.takeaway-text {
    font-size: 0.88rem;
    color: #fff;
    line-height: 1.45;
}

.topics-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topic-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
}

.topic-count {
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--bg-surface-elevated);
    font-size: 0.72rem;
}

.reviews-feed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}

.review-item {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.review-stars {
    color: var(--color-rose);
    letter-spacing: 2px;
    font-size: 0.9rem;
}

.review-author {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.review-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: #fff;
    margin-bottom: 4px;
}

.review-snippet {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==========================================================================
   Modals & Forms
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop.hidden {
    display: none;
}

.modal-dialog {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 540px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover { color: #fff; }

.modal-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input, .form-textarea, .form-select {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    width: 100%;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.search-input-wrap {
    display: flex;
    gap: 10px;
}

.search-results-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.search-app-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}
.search-app-item:hover {
    border-color: var(--border-accent);
}

.search-app-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-app-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.search-app-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #fff;
}

.search-app-dev {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    cursor: pointer;
    color: var(--text-primary);
}

.alert-preview-box {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.alert-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.alert-tag-green {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-emerald);
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.alert-tag-indigo {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.12);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.alert-preview-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 4px;
}

.alert-preview-body {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-accent);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    animation: toastIn 0.25s ease-out;
}

.toast.hidden { display: none; }

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

/* Portfolio Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.portfolio-app-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s ease;
}

.portfolio-app-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

.p-app-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.p-app-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.p-app-name {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.p-app-dev {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.p-app-stats {
    display: flex;
    justify-content: space-between;
    background: var(--bg-base);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.p-stat-val {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.p-stat-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state.hidden { display: none; }
.empty-state h3 {
    color: #fff;
    margin: 12px 0 6px;
    font-family: var(--font-heading);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-subtle); }
    .nav-tabs { flex-direction: row; flex-wrap: wrap; }
    .main-content { padding: 20px; }
    .two-col-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Light Theme Component Overrides
   ========================================================================== */

[data-theme="light"] .brand-name,
[data-theme="light"] .view-title,
[data-theme="light"] .kpi-value,
[data-theme="light"] .card-title,
[data-theme="light"] .banner-app-name,
[data-theme="light"] .climber-kw,
[data-theme="light"] .rank-cell,
[data-theme="light"] .kw-cell,
[data-theme="light"] .comp-name,
[data-theme="light"] .timeline-title,
[data-theme="light"] .goldmine-title,
[data-theme="light"] .gauge-score,
[data-theme="light"] .aso-tier-title,
[data-theme="light"] .meter-name,
[data-theme="light"] .takeaway-text,
[data-theme="light"] .review-title,
[data-theme="light"] .modal-header h2,
[data-theme="light"] .search-app-name,
[data-theme="light"] .alert-preview-title,
[data-theme="light"] .p-app-name,
[data-theme="light"] .p-stat-val,
[data-theme="light"] .empty-state h3,
[data-theme="light"] .plan-title {
    color: var(--text-primary);
}

[data-theme="light"] .goldmine-card {
    border-color: rgba(2, 132, 199, 0.25);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), #ffffff);
}

[data-theme="light"] .plan-card {
    background: linear-gradient(180deg, #f1f5f9, #ffffff);
    border-color: var(--border-subtle);
}

[data-theme="light"] .nav-item:hover {
    background: rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .nav-item.active {
    background: rgba(79, 70, 229, 0.08);
    color: var(--color-primary);
}

[data-theme="light"] .data-table tr:hover td {
    background: rgba(15, 23, 42, 0.02);
}

[data-theme="light"] .toast {
    background: #ffffff;
    color: var(--text-primary);
    border-color: var(--border-subtle);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .modal-dialog {
    background: #ffffff;
    border-color: var(--border-subtle);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-textarea,
[data-theme="light"] .form-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-textarea:focus,
[data-theme="light"] .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

[data-theme="light"] .btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

[data-theme="light"] .btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

[data-theme="light"] .btn-icon {
    background: #ffffff;
    border-color: #cbd5e1;
    color: var(--text-secondary);
}

[data-theme="light"] .btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--color-primary);
}

[data-theme="light"] .country-pill,
[data-theme="light"] .app-selector-container {
    background: #ffffff;
    border-color: #cbd5e1;
}

[data-theme="light"] .app-dropdown option,
[data-theme="light"] .country-dropdown option {
    background: #ffffff;
    color: var(--text-primary);
}

[data-theme="light"] .gauge-bg {
    stroke: #e2e8f0;
}

/* ==========================================================================
   Apple Search Autocomplete / Suggestion Tags (Feature 2)
   ========================================================================== */
.autosuggest-box {
    background: var(--bg-surface-elevated);
    border: 1px dashed var(--border-accent);
    border-radius: var(--radius-md);
    padding: 14px;
}

.autosuggest-box-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.autosuggest-sub {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.suggest-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    align-items: center;
}

.suggest-hint-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.suggest-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--color-primary-glow);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-primary-light);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.suggest-tag:hover {
    background: var(--color-primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.suggest-tag-plus {
    font-weight: 700;
    font-size: 0.95rem;
}

/* ==========================================================================
   Keyword Tracker Row Expansion & Detailed SVG Chart (Feature 4)
   ========================================================================== */
.keyword-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.keyword-row:hover {
    background: var(--bg-surface-elevated) !important;
}

.keyword-row.is-expanded {
    background: var(--bg-surface-elevated) !important;
    border-left: 3px solid var(--color-primary);
}

.rank-drawer-tr {
    background: var(--bg-surface-elevated);
}

.rank-drawer-cell {
    padding: 0 !important;
}

.rank-drawer-content {
    padding: 20px 24px;
    border-top: 1px dashed var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    animation: drawerSlideDown 0.25s ease-out;
}

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

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.drawer-title-group h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-stats-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.drawer-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.chart-expanded-container {
    width: 100%;
    height: 180px;
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 14px;
}

.chart-expanded-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-axis-line {
    stroke: var(--border-subtle);
    stroke-dasharray: 4 4;
}

.chart-data-point {
    r: 4;
    transition: r 0.2s ease, fill 0.2s ease;
    cursor: pointer;
}
.chart-data-point:hover {
    r: 7;
}

.chart-legend {
    display: flex;
    gap: 20px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    justify-content: flex-end;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.legend-dot-climb {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}
.legend-dot-fall {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f43f5e;
}

/* ==========================================================================
   Competitor Screenshot & Creative Visual Diff (Feature 3)
   ========================================================================== */
.screenshot-diff-gallery {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 14px;
}

.ss-competitor-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s ease;
}

.ss-comp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.ss-comp-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ss-comp-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.ss-comp-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.ss-diff-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

.ss-diff-badge.detected {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.ss-diff-badge.stable {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

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

@media (max-width: 768px) {
    .ss-comparison-grid {
        grid-template-columns: 1fr;
    }
}

.ss-column-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
}

.ss-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ss-badge-curr {
    color: #10b981;
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.12);
    border-radius: var(--radius-full);
}

.ss-badge-prev {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
}

.ss-scroll-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}

.ss-mockup-frame {
    flex: 0 0 140px;
    scroll-snap-align: start;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-subtle);
    background: #000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.ss-mockup-frame:hover {
    transform: scale(1.03);
    border-color: var(--color-primary);
}

.ss-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 9/19.5;
    object-fit: cover;
}

.ss-empty-box {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* ==========================================================================
   One-Click ASO Audit Report & Printable Layout (Feature 6)
   ========================================================================== */
.modal-dialog-lg {
    max-width: 860px;
    width: 95%;
}

.report-header-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.report-header-sub {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.report-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-body {
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
}

.report-hero-card {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.report-app-icon {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.report-app-meta h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.report-app-sub {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.report-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.report-pill {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.report-section {
    margin-bottom: 28px;
}

.report-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.report-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
}

.report-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.rank-badge-report {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
}

.rank-badge-report.top3 {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}
.rank-badge-report.top10 {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}
.rank-badge-report.other {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

/* Printable PDF View (@media print) */
@media print {
    body {
        background: #ffffff !important;
        color: #0f172a !important;
    }

    .top-nav,
    .sidebar,
    .toast,
    .no-print,
    .tab-view {
        display: none !important;
    }

    .app-layout {
        display: block !important;
        padding: 0 !important;
    }

    #modalReport {
        position: static !important;
        display: block !important;
        background: none !important;
        padding: 0 !important;
    }

    .modal-dialog,
    .printable-report-dialog {
        max-width: 100% !important;
        width: 100% !important;
        border: none !important;
        box-shadow: none !important;
        background: #ffffff !important;
        color: #0f172a !important;
    }

    .report-body {
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .report-hero-card,
    .ss-column-box,
    .chart-expanded-container,
    .report-table th {
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        color: #0f172a !important;
    }

    .report-table td {
        border-bottom: 1px solid #e2e8f0 !important;
        color: #0f172a !important;
    }

    .report-section-title {
        color: #0f172a !important;
        border-bottom: 2px solid #0f172a !important;
    }
}

/* ==========================================================================
   Keyword Difficulty & Rank Chance Score (Phase 2 - Feature 2)
   ========================================================================== */
.diff-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.diff-easy {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.diff-mod {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.diff-hard {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.diff-score-tag {
    font-weight: 800;
    opacity: 0.85;
}

/* ==========================================================================
   Keyword Cannibalization & Coverage Map (Phase 2 - Feature 1)
   ========================================================================== */
.cannibalization-alert-box {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    line-height: 1.5;
}

.cannibalization-alert-box.has-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.cannibalization-alert-box.is-clean {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.coverage-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.coverage-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.coverage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-title { background: #10b981; }
.dot-sub { background: #6366f1; }

.coverage-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-tag {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
}

.chip-tag.chip-title {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.chip-tag.chip-sub {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.chip-tag.chip-duplicate {
    background: rgba(244, 63, 94, 0.2);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.5);
    font-weight: 700;
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0%, 100% { border-color: rgba(244, 63, 94, 0.5); }
    50% { border-color: rgba(244, 63, 94, 0.9); box-shadow: 0 0 10px rgba(244, 63, 94, 0.3); }
}

.replacement-suggestions-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.repl-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   AI ASO Rewrite Assistant (Phase 2 - Feature 4)
   ========================================================================== */
.ai-rewrites-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-rewrite-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s ease;
}

.ai-rewrite-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
}

.ai-rewrite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-badge-style {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-primary-light);
    background: var(--color-primary-glow);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.ai-field-row {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-field-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-field-val {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: inherit;
}

.ai-char-counter {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.ai-reasoning {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-top: 10px;
    line-height: 1.4;
}

.ai-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    justify-content: flex-end;
}

/* ==========================================================================
   Multi-Country / Global Geo Grid (Phase 2 - Feature 3)
   ========================================================================== */
.geo-heat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.88rem;
    transition: transform 0.15s ease;
}

.geo-heat-pill:hover {
    transform: scale(1.08);
}

.geo-top3 {
    background: rgba(16, 185, 129, 0.22);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.geo-top10 {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.geo-top50 {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.geo-unranked {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-tertiary);
    border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   App Store Category Top Charts (Phase 2 - Feature 5)
   ========================================================================== */
.category-banner {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.category-banner.celebration {
    border: 2px solid #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(99, 102, 241, 0.1));
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.banner-celebration-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 10px;
}

.banner-celebration-sub {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.category-rank-badge {
    font-size: 1.8rem;
    font-weight: 900;
    color: #10b981;
    background: rgba(16, 185, 129, 0.18);
    padding: 6px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.topchart-rank {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-secondary);
}

.topchart-rank.top3 {
    color: #f59e0b;
    font-size: 1.3rem;
}

.topchart-app-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topchart-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
}

.topchart-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.topchart-summary {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ==========================================================================
   Phase 3: Enterprise & High-Ticket Feature Suite
   ========================================================================== */

/* Dual-Store Switcher Toggle */
.store-switcher-toggle {
    display: inline-flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 3px;
}

.store-btn {
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.store-btn:hover {
    color: var(--text-primary);
}

.store-btn.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.btn-whitelabel-mode {
    background: rgba(168, 85, 247, 0.15) !important;
    border: 1px solid rgba(168, 85, 247, 0.4) !important;
    color: #c084fc !important;
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-whitelabel-mode:hover {
    background: rgba(168, 85, 247, 0.28) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

/* Brand Defense Alert Banner (Apple Search Ads Hijack Detector) */
.brand-defense-banner {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.18) 0%, rgba(225, 29, 72, 0.08) 100%);
    border: 1.5px solid rgba(244, 63, 94, 0.55);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(244, 63, 94, 0.15);
    animation: pulseBorder 3s infinite alternate;
}

@keyframes pulseBorder {
    0% { border-color: rgba(244, 63, 94, 0.4); }
    100% { border-color: rgba(244, 63, 94, 0.85); box-shadow: 0 0 20px rgba(244, 63, 94, 0.25); }
}

.defense-banner-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.defense-banner-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    min-width: 280px;
}

.defense-icon-shield {
    font-size: 2rem;
    padding: 10px;
    background: rgba(244, 63, 94, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid rgba(244, 63, 94, 0.4);
    line-height: 1;
}

.defense-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f43f5e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.defense-sub {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.defense-sub strong {
    color: #fff;
}

.defense-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Algorithm Velocity & Stale App Penalty Risk Banner */
.algo-velocity-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.06) 100%);
    border: 1.5px solid rgba(245, 158, 11, 0.45);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.12);
}

.velocity-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.velocity-banner-text {
    flex: 1;
    min-width: 280px;
}

.velocity-banner-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.velocity-banner-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.velocity-stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.v-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-base);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.v-stat-label {
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.v-stat-val {
    font-size: 0.92rem;
    font-weight: 700;
}

/* Strategic Marketing Weapons Grid (Review Intelligence) */
.weapons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.weapon-card {
    background: var(--bg-card);
    border: 1.5px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.weapon-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.weapon-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.weapon-tag {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.weapon-mentions {
    font-size: 0.78rem;
    font-weight: 600;
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.12);
    padding: 2px 8px;
    border-radius: 12px;
}

.weapon-frustration {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.weapon-copy-box {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    position: relative;
}

.weapon-copy-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: #10b981;
    display: block;
}

.weapon-copy-sub {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.weapon-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.weapon-placement {
    font-size: 0.76rem;
    color: var(--text-tertiary);
}

/* Playbook & Conquest Lists */
.playbook-item {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
}

.conquest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.conquest-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.conquest-cpt {
    font-size: 0.85rem;
    font-weight: 700;
    color: #10b981;
}

/* Cross-Platform Store Rules & Density Analyzer */
.store-rules-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.store-rules-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.store-rules-list li strong {
    color: var(--text-primary);
}

.store-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-size: 0.82rem;
    font-weight: 700;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.textarea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.char-counter {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.density-status-pill {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
}

.density-optimal {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.density-low {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.density-spam {
    background: rgba(244, 63, 94, 0.22);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.5);
    font-weight: 800;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}

/* White-Label Agency Preview Box */
.whitelabel-preview-box {
    background: var(--bg-base);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.wl-topbar {
    padding: 12px 18px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wl-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wl-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
}

.wl-agency-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: #fff;
}

.wl-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
}

.wl-content {
    padding: 20px;
}

.wl-client-welcome {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.wl-client-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.wl-mini-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.wl-kpi {
    background: var(--bg-card);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    text-align: center;
}

.wl-kpi-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-primary);
}

.wl-kpi-lbl {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.wl-domain-box {
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wl-domain-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
}

.wl-domain-box code {
    color: #a855f7;
    font-size: 0.82rem;
    word-break: break-all;
}

/* Agency Live Mode Body Customization */
body.agency-mode {
    --color-primary: var(--agency-primary, #a855f7);
}

body.agency-mode .brand-text {
    display: none;
}

body.agency-mode .brand-icon-wrap {
    background: var(--agency-primary, #a855f7);
}

body.agency-mode .brand-logo::after {
    content: var(--agency-name, "Apex Agency Portal");
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
    margin-left: 8px;
}

body.agency-mode .plan-card {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.08);
}

body.agency-mode .plan-badge {
    background: #a855f7;
    color: #fff;
}
