/* Design Tokens */
:root {
    /* Colors */
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    
    /* Score Colors */
    --score-high: #10b981;
    --score-medium: #f59e0b;
    --score-low: #ef4444;
    
    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, Consolas, monospace;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-8);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.nav {
    display: flex;
    gap: var(--space-6);
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    background: var(--color-bg);
    border-color: var(--color-text-muted);
}

.link-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
}

/* Main Content */
.main {
    flex: 1;
    padding: var(--space-8);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: var(--space-16) 0;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: var(--space-4);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto var(--space-8);
}

/* Input Container */
.input-container {
    max-width: 700px;
    margin: 0 auto var(--space-10);
}

.input-wrapper {
    display: flex;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--color-primary);
}

.url-input {
    flex: 1;
    padding: var(--space-4) var(--space-5);
    font-size: 1rem;
    border: none;
    outline: none;
    background: transparent;
}

.url-input::placeholder {
    color: var(--color-text-muted);
}

.analyze-btn {
    padding: var(--space-4) var(--space-6);
    border-radius: 0;
    min-width: 120px;
}

.input-hint {
    margin-top: var(--space-3);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Trust Badges */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: var(--space-10);
}

.badge {
    text-align: center;
}

.badge-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-primary);
}

.badge-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Results Section */
.results {
    max-width: 900px;
    margin: 0 auto;
}

.back-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: var(--space-6);
    padding: var(--space-2) 0;
}

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

/* Score Card */
.score-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-6);
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.listing-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.listing-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.listing-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.listing-source {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.score-display {
    text-align: center;
}

.score-circle {
    position: relative;
    width: 100px;
    height: 100px;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 8;
}

.score-progress {
    fill: none;
    stroke: var(--color-text-muted);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease, stroke 0.5s;
}

.score-progress.high { stroke: var(--score-high); }
.score-progress.medium { stroke: var(--score-medium); }
.score-progress.low { stroke: var(--score-low); }

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.75rem;
    font-weight: 800;
}

.score-label {
    display: block;
    margin-top: var(--space-2);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-label.high { color: var(--score-high); }
.score-label.medium { color: var(--score-medium); }
.score-label.low { color: var(--score-low); }

.score-summary {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-4);
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.analysis-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.analysis-icon {
    font-size: 1.25rem;
}

.analysis-header h3 {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
}

.status-badge {
    font-size: 0.75rem;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-weight: 600;
    background: var(--color-bg);
    color: var(--color-text-muted);
}

.status-badge.pass {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.status-badge.fail {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

/* Price Comparison */
.price-comparison {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-item.highlight {
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-2);
}

.price-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.price-value {
    font-weight: 600;
}

.price-value.danger {
    color: var(--color-danger);
}

/* Image Checks */
.image-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.image-check {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.check-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.check-indicator.pass {
    background: rgba(16, 185, 129, 0.1);
}

.check-indicator.fail {
    background: rgba(239, 68, 68, 0.1);
}

.check-label {
    font-size: 0.9rem;
}

/* Account Stats */
.account-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.stat-row {
    display: flex;
    justify-content: space-between;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.stat-value {
    font-weight: 600;
}

.stat-value.danger {
    color: var(--color-danger);
}

/* Flags List */
.flags-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.flag-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9rem;
    padding: var(--space-2);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
}

.flag-item.danger {
    background: rgba(239, 68, 68, 0.08);
}

/* Red Flags Section */
.red-flags {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}

.red-flags h3 {
    color: var(--color-danger);
    margin-bottom: var(--space-4);
}

.flags-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.red-flag-item {
    background: var(--color-surface);
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--color-danger);
}

.red-flag-item h4 {
    font-size: 0.95rem;
    margin-bottom: var(--space-1);
}

.red-flag-item p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Recommendations */
.recommendations {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.recommendations h3 {
    margin-bottom: var(--space-4);
}

.rec-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.rec-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
}

.rec-icon {
    font-size: 1.25rem;
}

.rec-content h4 {
    font-size: 0.95rem;
    margin-bottom: var(--space-1);
}

.rec-content p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Actions */
.actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

/* How It Works */
.how-it-works {
    margin-top: var(--space-16);
    text-align: center;
}

.how-it-works h2 {
    font-size: 1.75rem;
    margin-bottom: var(--space-8);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
}

.step {
    text-align: center;
}

.step-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-4);
}

.step h3 {
    font-size: 1rem;
    margin-bottom: var(--space-2);
}

.step p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Recent Scams */
.recent-scams {
    margin-top: var(--space-16);
}

.recent-scams h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-6);
    text-align: center;
}

.scams-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

.scam-card {
    background: var(--color-surface);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.scam-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}

.scam-badge.danger {
    background: var(--color-danger);
    color: white;
}

.scam-card h4 {
    font-size: 0.95rem;
    margin-bottom: var(--space-2);
}

.scam-detail {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

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

/* Footer */
.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-8);
    margin-top: var(--space-16);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
}

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--color-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: var(--space-3) var(--space-4);
    }
    
    .nav {
        display: none;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .analyze-btn {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
    
    .trust-badges {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .scams-grid {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
}
