/* ============================================================
   KDPRanker - Main Application CSS
   Dark premium theme
   ============================================================ */

/* ---- Reset & Variables ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Background */
    --bg-body: #08080d;
    --bg-primary: #0c0c14;
    --bg-secondary: #111119;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1e1e2a;
    --bg-sidebar: #0e0e16;

    /* Borders */
    --border: #1e1e2e;
    --border-light: #282838;
    --border-focus: #6366f1;

    /* Text */
    --text-primary: #eaeaf0;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --text-inverse: #ffffff;

    /* Accent */
    --accent: #6366f1;
    --accent-hover: #5558e6;
    --accent-light: rgba(99, 102, 241, 0.12);
    --accent-glow: rgba(99, 102, 241, 0.25);

    /* Semantic */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Spacing */
    --sidebar-width: 260px;
    --topbar-height: 64px;

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--accent-hover);
}

/* ============================================================
   Layout
   ============================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 10px;
    margin-bottom: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-light);
    color: var(--accent);
}

.sidebar-link.active .sidebar-icon {
    color: var(--accent);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active .sidebar-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--bg-card);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-plan {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Top Bar ---- */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-breadcrumb a {
    color: var(--text-secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-credits {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
}

.topbar-credits strong {
    color: var(--accent);
    font-weight: 700;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

/* ---- Page Content ---- */
.page-content {
    flex: 1;
    padding: 32px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ============================================================
   Cards
   ============================================================ */

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.stat-card-icon.blue {
    background: var(--info-bg);
    color: var(--info);
}

.stat-card-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-card-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #a855f7;
}

.stat-card-icon.orange {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-card-icon.red {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
}

.stat-card-change.up {
    color: var(--success);
    background: var(--success-bg);
}

.stat-card-change.down {
    color: var(--danger);
    background: var(--danger-bg);
}

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

.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.table-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrapper thead th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table-wrapper tbody td {
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table-wrapper tbody tr:last-child td {
    border-bottom: none;
}

.table-wrapper tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.table-wrapper tbody tr {
    transition: background var(--transition-fast);
}

/* ============================================================
   Badges & Tags
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green {
    background: var(--success-bg);
    color: var(--success);
}

.badge-yellow {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-red {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-blue {
    background: var(--info-bg);
    color: var(--info);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #a855f7;
}

.badge-gray {
    background: rgba(100, 100, 120, 0.15);
    color: var(--text-secondary);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ============================================================
   Forms
   ============================================================ */

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

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

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

.form-control {
    width: 100%;
    padding: 11px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.search-box {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.search-box .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ============================================================
   Cards (Content)
   ============================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.98);
    transition: transform var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   Notifications / Toast
   ============================================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.warning {
    border-left: 3px solid var(--warning);
}

.toast.info {
    border-left: 3px solid var(--info);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================================
   Chart Placeholders
   ============================================================ */

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

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

.chart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-placeholder {
    height: 280px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
}

.chart-placeholder-icon {
    font-size: 40px;
    opacity: 0.5;
}

.chart-placeholder-text {
    font-size: 14px;
}

/* Mini bar chart mockup */
.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
}

.mini-chart-bar {
    width: 6px;
    border-radius: 2px;
    background: var(--accent);
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.mini-chart:hover .mini-chart-bar {
    opacity: 1;
}

/* ============================================================
   Score Display
   ============================================================ */

.score-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
}

.score-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 6px solid var(--border);
}

.score-ring-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.score-ring-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 4px;
}

/* ============================================================
   Progress Bar
   ============================================================ */

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width var(--transition-slow);
}

.progress-fill.green { background: var(--success); }
.progress-fill.yellow { background: var(--warning); }
.progress-fill.red { background: var(--danger); }
.progress-fill.blue { background: var(--info); }
.progress-fill.purple { background: #a855f7; }

/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   Tabs
   ============================================================ */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    padding-bottom: 0;
}

.tab-btn {
    padding: 10px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
}

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

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================================
   Tooltip
   ============================================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

/* ============================================================
   Loading Spinner
   ============================================================ */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 13, 0.7);
    border-radius: var(--radius-lg);
    z-index: 10;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

/* ============================================================
   Keyword Research Specific
   ============================================================ */

.keyword-volume {
    font-weight: 700;
    color: var(--text-primary);
}

.opportunity-score {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.opportunity-score.high { color: var(--success); }
.opportunity-score.medium { color: var(--warning); }
.opportunity-score.low { color: var(--danger); }

/* ============================================================
   ASIN Results
   ============================================================ */

.asin-result-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 24px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.asin-cover {
    width: 120px;
    height: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    overflow: hidden;
}

.asin-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asin-details h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.asin-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.asin-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.asin-meta-item strong {
    color: var(--text-primary);
}

/* ============================================================
   Listing Optimizer
   ============================================================ */

.optimization-score {
    text-align: center;
    padding: 32px;
}

.optimization-score .score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
}

.optimization-score .score-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 8px solid var(--border);
}

.optimization-score .score-number {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.optimization-score .score-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 4px;
}

.strengths-weaknesses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.sw-card {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.sw-card.strengths {
    background: var(--success-bg);
    border-color: rgba(34, 197, 94, 0.2);
}

.sw-card.weaknesses {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.2);
}

.sw-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.sw-card.strengths h4 { color: var(--success); }
.sw-card.weaknesses h4 { color: var(--danger); }

.sw-card ul {
    list-style: none;
}

.sw-card ul li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.sw-card ul li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.sw-card.strengths ul li::before { background: var(--success); }
.sw-card.weaknesses ul li::before { background: var(--danger); }

/* ============================================================
   Rank Tracker
   ============================================================ */

.rank-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 13px;
}

.rank-change.up { color: var(--success); }
.rank-change.down { color: var(--danger); }
.rank-change.same { color: var(--text-muted); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .page-content {
        padding: 24px 20px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .strengths-weaknesses {
        grid-template-columns: 1fr;
    }

    .asin-result-card {
        grid-template-columns: 1fr;
    }

    .asin-cover {
        width: 100px;
        height: 150px;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0 16px;
    }

    .topbar-credits {
        display: none;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .stat-card-value {
        font-size: 26px;
    }

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

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Scrollbar
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================
   Landing Page
   ============================================================ */

.landing-page {
    min-height: 100vh;
    background: var(--bg-body);
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(8, 8, 13, 0.9);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.landing-nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.landing-nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

.landing-hero {
    text-align: center;
    padding: 100px 40px 80px;
    max-width: 800px;
    margin: 0 auto;
}

.landing-hero h1 {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #eaeaf0, #8888a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.landing-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.landing-cta .btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.landing-features {
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.landing-features h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.landing-features .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 60px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.feature-card-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.landing-pricing {
    padding: 80px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.landing-pricing h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.landing-pricing .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 60px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pricing-card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    position: relative;
    transition: all var(--transition);
}

.pricing-card.popular {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.pricing-card.popular::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.pricing-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-card .price {
    font-size: 40px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pricing-card .price span {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.pricing-card .price-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: 32px;
}

.pricing-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-features li::before {
    content: '';
    width: 18px;
    height: 18px;
    background: var(--success-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.landing-footer {
    border-top: 1px solid var(--border);
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

@media (max-width: 768px) {
    .landing-hero h1 {
        font-size: 36px;
    }

    .features-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .landing-nav {
        padding: 12px 20px;
    }

    .landing-nav-links {
        display: none;
    }
}
