/* ============ ASIN Dashboard - LSB ============ */
/* Professional Amazon Seller Theme */

:root {
    --primary: #232f3e;
    --primary-light: #37475a;
    --accent: #ff9900;
    --accent-hover: #e88b00;
    --success: #067d62;
    --success-light: #e8f5e9;
    --danger: #d32f2f;
    --danger-light: #fce4ec;
    --warning: #f57c00;
    --warning-light: #fff3e0;
    --info: #0288d1;
    --info-light: #e1f5fe;
    --bg: #f5f6fa;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6c757d;
    --border: #e3e6f0;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
    
    /* Tier colors */
    --tier1: #1565c0;
    --tier1-bg: #e3f2fd;
    --tier2: #2e7d32;
    --tier2-bg: #e8f5e9;
    --tier3: #e65100;
    --tier3-bg: #fff3e0;
    --tier4: #757575;
    --tier4-bg: #f5f5f5;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ============ NAVBAR ============ */
.bg-dark-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.text-primary-accent { color: var(--accent) !important; }
.text-light-muted { color: rgba(255,255,255,0.7) !important; }
.text-danger-soft { color: #ff6b6b !important; }
.text-danger-soft:hover { color: #ff4444 !important; }
.bg-primary-accent { background-color: var(--accent) !important; }

/* ============ LOGIN ============ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #232f3e 0%, #37475a 50%, #485769 100%);
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card .logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .logo i {
    font-size: 48px;
    color: var(--accent);
}

.login-card .logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 12px;
}

.login-card .logo p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============ CARDS ============ */
.card-custom {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card-custom:hover {
    box-shadow: var(--shadow-hover);
}

.card-header-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 16px 20px;
    font-weight: 600;
}

/* ============ KPI CARDS ============ */
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.kpi-card .kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}

.kpi-card .kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.kpi-card .kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.kpi-card .kpi-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--danger); }

/* ============ TIER BADGES ============ */
.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.tier-1 { background: var(--tier1-bg); color: var(--tier1); border: 1px solid var(--tier1); }
.tier-2 { background: var(--tier2-bg); color: var(--tier2); border: 1px solid var(--tier2); }
.tier-3 { background: var(--tier3-bg); color: var(--tier3); border: 1px solid var(--tier3); }
.tier-4 { background: var(--tier4-bg); color: var(--tier4); border: 1px solid var(--tier4); }

/* ============ TIER FILTER BUTTONS ============ */
.tier-filter-group .btn {
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.tier-filter-group .btn.active {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ============ TABLE ============ */
.table-custom {
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom thead th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-custom thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.table-custom thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.table-custom tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 13px;
}

.table-custom tbody tr {
    transition: var(--transition);
}

.table-custom tbody tr:hover {
    background: #f8f9ff;
}

.table-custom .asin-title {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.table-custom .asin-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: var(--info);
    font-weight: 500;
}

/* ============ ACCOUNT CARDS ============ */
.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.account-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
    color: inherit;
    text-decoration: none;
}

.account-card .acc-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.account-card .acc-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.account-card .metric {
    text-align: center;
}

.account-card .metric-value {
    font-size: 18px;
    font-weight: 700;
}

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

/* ============ ANALYSIS SECTION ============ */
.analysis-result {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    line-height: 1.8;
    font-size: 14px;
    max-height: 800px;
    overflow-y: auto;
}

.analysis-result .analysis-paragraph {
    margin-bottom: 16px;
    padding-bottom: 8px;
}

.analysis-result .analysis-paragraph:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.analysis-result b {
    color: var(--primary);
    display: inline;
    font-size: 15px;
}

.analysis-result i {
    color: var(--text-muted);
}

/* ============ ACTION ITEMS ============ */
.action-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
    background: white;
}

.action-item:hover {
    border-color: var(--accent);
}

.action-item.completed {
    background: var(--success-light);
    border-color: var(--success);
}

.action-item.completed .action-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.action-item .action-check {
    cursor: pointer;
    font-size: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 2px;
}

.action-item.completed .action-check {
    color: var(--success);
}

/* ============ COMPARISON TABLE ============ */
.comparison-card {
    border-radius: var(--radius);
    overflow: hidden;
}

.change-positive { color: var(--success); font-weight: 600; }
.change-negative { color: var(--danger); font-weight: 600; }
.change-neutral { color: var(--text-muted); }

/* For ACOS/Spend, lower is better */
.change-positive-inverse { color: var(--danger); font-weight: 600; }
.change-negative-inverse { color: var(--success); font-weight: 600; }

/* ============ CHARTS ============ */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

/* ============ BUTTONS ============ */
.btn-accent {
    background: var(--accent);
    color: white;
    border: none;
    font-weight: 600;
    transition: var(--transition);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-analyze {
    background: linear-gradient(135deg, var(--accent) 0%, #e88b00 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-analyze:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,153,0,0.4);
    color: white;
}

.btn-analyze:disabled {
    opacity: 0.6;
    transform: none;
}

/* ============ BREADCRUMB ============ */
.breadcrumb-custom {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-custom .breadcrumb-item a {
    color: var(--info);
    text-decoration: none;
}

.breadcrumb-custom .breadcrumb-item.active {
    color: var(--text-muted);
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* ============ LOADING ============ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,153,0,0.3);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 0.8s ease-in-out infinite;
}

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

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .kpi-card .kpi-value { font-size: 20px; }
    .table-custom { font-size: 12px; }
    .table-custom thead th, .table-custom tbody td { padding: 8px 10px; }
    .account-card .acc-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ============ FOOTER ============ */
.footer-custom {
    border-top: 1px solid var(--border);
    background: white;
}

/* ============ MISC ============ */
.text-accent { color: var(--accent) !important; }
.bg-accent-light { background: #fff8ec !important; }
.border-accent { border-color: var(--accent) !important; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-input {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 14px;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,153,0,0.15);
    outline: none;
}

/* Number formatting */
.num-positive { color: var(--success); }
.num-negative { color: var(--danger); }
.num-warning { color: var(--warning); }
