:root {
    /* Color Palette - Mystic Night */
    --bg-dark: #020617;
    --bg-panel: #0f172a;
    --primary: #8b5cf6;
    /* Violet */
    --primary-glow: rgba(139, 92, 246, 0.5);
    --secondary: #06b6d4;
    /* Cyan */
    --accent: #f59e0b;
    /* Amber/Gold */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);

    /* Effects */
    --glass: rgba(15, 23, 42, 0.6);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --glow: 0 0 20px var(--primary-glow);

    /* Fonts */
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.8s ease-out;
}

header {
    text-align: center;
    padding: 2rem 0;
    position: relative;
}

header h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.controls {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.category-selector {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.category-selector button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.category-selector button:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background: rgba(139, 92, 246, 0.1);
}

.category-selector button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.status-bar {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    flex-grow: 1;
    text-align: right;
    margin-right: 1.5rem;
}

.primary-btn {
    background: linear-gradient(135deg, var(--secondary), #3b82f6);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.table-container {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.item-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.item-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.item-cell span {
    font-weight: 500;
    font-size: 1rem;
}

.profit-positive {
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.profit-negative {
    color: var(--text-muted);
    opacity: 0.6;
}

.profit-route {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

a:hover {
    color: #67e8f9;
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .status-bar {
        text-align: left;
        width: 100%;
        order: 2;
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .primary-btn {
        width: 100%;
        order: 3;
    }
}