/* Core Variables */
:root {
    /* Theme Colors */
    --ai-primary: #00ff88;
    --ai-secondary: #0088ff;
    --ai-accent: #ff00ff;
    --ai-warning: #ffbb00;
    --ai-error: #ff3366;
    --ai-success: #00ffaa;
    --ai-glow: rgba(0, 255, 136, 0.2);
    
    /* Backgrounds */
    --bg-dark: #0a0a0f;
    --bg-darker: #050507;
    --bg-darkest: #030304;
    --bg-light: #ffffff;
    --glass-bg: rgba(10, 10, 15, 0.8);
    
    /* Structure - Adjusted heights */
    --header-height: 50px;
    --ticker-height: 30px;
    --total-header: calc(var(--header-height) + var(--ticker-height));
    
    /* Effects */
    --glow-primary: 0 0 20px rgba(0, 255, 136, 0.4);
    --glow-secondary: 0 0 20px rgba(0, 136, 255, 0.4);
    --glow-subtle: 0 0 10px rgba(0, 255, 136, 0.2);
    --border-glow: 1px solid rgba(0, 255, 136, 0.3);
}

/* Base Layout */
body {
    background-color: var(--bg-darkest);
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    line-height: 1.5;
    margin: 0;
    min-height: 100vh;
    padding-top: var(--total-header);
}

/* Price Ticker */
.price-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ticker-height);
    background: linear-gradient(90deg, 
        rgba(0,0,0,0.95) 0%, 
        rgba(0,20,10,0.95) 50%, 
        rgba(0,0,0,0.95) 100%);
    border-bottom: var(--border-glow);
    box-shadow: var(--glow-primary);
    z-index: 1100;
    overflow: hidden;
}

.ticker-wrapper {
    display: inline-flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    padding-left: 100%;
    animation: ticker 30s linear infinite;
}

/* Navigation Bar - Adjusted positioning */
.crypto-nav {
    position: fixed;
    top: var(--ticker-height);
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: var(--border-glow);
    z-index: 1050;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
}

/* Main Content Area */
.crypto-monitor-main {
    padding: 1rem;
    margin-top: 1rem;
}

/* Table Styling */
.crypto-table-wrapper {
    background: var(--bg-darkest);
    border-radius: 12px;
    border: var(--border-glow);
    box-shadow: var(--glow-subtle);
    overflow: hidden;
    position: relative;
}

.crypto-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

/* Table Headers */
.crypto-table thead th {
    background: linear-gradient(180deg,
        rgba(0, 255, 136, 0.1),
        transparent);
    color: var(--ai-primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1rem;
    border-bottom: var(--border-glow);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Table Rows */
.crypto-table tbody tr {
    position: relative;
    transition: all 0.3s ease;
}

.crypto-table tbody td {
    padding: 1rem;
    background: inherit;
    transition: background-color 0.3s ease;
}

/* Row Color States */
.crypto-table tbody tr[data-change="positive"] td {
    background-color: rgba(0, 255, 136, 0.03);
}

.crypto-table tbody tr[data-change="positive"]:hover td {
    background-color: rgba(0, 255, 136, 0.08);
}

.crypto-table tbody tr[data-change="negative"] td {
    background-color: rgba(255, 51, 102, 0.03);
}

.crypto-table tbody tr[data-change="negative"]:hover td {
    background-color: rgba(255, 51, 102, 0.08);
}

/* Change Indicators */
.change-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: 500;
    font-family: 'Roboto Mono', monospace;
}

.change-value.text-success {
    color: var(--ai-success);
    border: 1px solid rgba(0, 255, 136, 0.2);
    background: rgba(0, 255, 136, 0.05);
}

.change-value.text-danger {
    color: var(--ai-error);
    border: 1px solid rgba(255, 51, 102, 0.2);
    background: rgba(255, 51, 102, 0.05);
}

/* Filter Section */
.filter-section {
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.95),
        rgba(0, 20, 10, 0.95));
    border: var(--border-glow);
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Form Controls */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.2);
    color: #fff;
    height: calc(var(--header-height) - 20px);
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--ai-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 255, 136, 0.15);
    color: #fff;
}

/* Price and Volume Values */
.price-value,
.volume-value,
.marketcap-value {
    font-family: 'Roboto Mono', monospace;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.1);
}

/* Loading States */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Animations */
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .crypto-table {
        min-width: 1000px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 45px;
        --ticker-height: 25px;
    }
    
    .filter-section {
        padding: 0.8rem;
    }
    
    .crypto-table td,
    .crypto-table th {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* Dark Mode Support */
[data-theme="dark"] {
    --text-primary: #ffffff;
    --text-secondary: #a0a7b5;
    --card-bg: rgba(10, 10, 15, 0.9);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .ticker-wrapper {
        animation: none;
    }
    
    .crypto-table tr,
    .change-value {
        transition: none;
    }
}

/* Print Styles */
@media print {
    body {
        padding-top: 0;
    }
    
    .price-ticker,
    .crypto-nav,
    .filter-section {
        display: none;
    }

    .crypto-table-wrapper {
        border: none;
        box-shadow: none;
    }
    
    .crypto-table {
        background: white;
        color: black;
    }
    
    .crypto-table th {
        background: none;
        color: black;
    }
}