* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #00d4ff, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
}

.time-window, .search, .refresh-info, .ginarea-link-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ginarea-logo {
    margin-right: 8px;
    cursor: help;
    display: inline-block;
    vertical-align: middle;
    font-size: 0.4rem;
    animation: pulse 2s infinite;
}

.ginarea-link {
    color: #00ff88;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-top: 8px;
    background: rgba(128, 128, 128, 0.2);
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid rgba(128, 128, 128, 0.3);
    display: inline-block;
    text-align: center;
}

.ginarea-link:hover {
    color: #00ff88;
    background: rgba(128, 128, 128, 0.3);
    border-color: rgba(128, 128, 128, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.time-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.time-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #b8c5d6;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.time-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.time-btn.active {
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    border-color: #00d4ff;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

label {
    font-weight: 600;
    color: #b8c5d6;
    font-size: 0.9rem;
}

select, input {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

select:focus, input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

select option {
    background: #1a1a2e;
    color: #ffffff;
}

#refreshBtn {
    padding: 12px 24px;
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#refreshBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

#refreshBtn:active {
    transform: translateY(0);
}

#lastUpdate {
    font-size: 0.9rem;
    color: #b8c5d6;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.column {
    display: flex;
    flex-direction: column;
}

.column-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
}

.column-title.gainers {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 255, 136, 0.05));
    border: 1px solid rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.column-title.losers {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 107, 107, 0.05));
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.table-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    flex: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead {
    background: rgba(255, 255, 255, 0.1);
}

th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #b8c5d6;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.9rem;
}

th:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

th:hover::after {
    opacity: 1;
}

td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.3s ease;
    font-size: 0.85rem;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.loading {
    text-align: center;
    color: #b8c5d6;
    font-style: italic;
    padding: 40px !important;
}

.positive {
    color: #00ff88;
    font-weight: 600;
}

.negative {
    color: #ff6b6b;
    font-weight: 600;
}

.neutral {
    color: #b8c5d6;
}

.ticker {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.empty-row {
    opacity: 0.3;
}

.empty-row td {
    color: #666;
    font-style: italic;
}

.volume {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

footer {
    margin-top: 30px;
    text-align: center;
    color: #b8c5d6;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .time-buttons {
        justify-content: center;
    }
    
    th, td {
        padding: 8px 4px;
        font-size: 0.75rem;
    }
    
    .ticker {
        max-width: 120px;
        font-size: 0.8rem;
    }
    
    .ginarea-logo {
        font-size: 0.3rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

tbody tr {
    animation: fadeIn 0.5s ease forwards;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Sort indicators */
th[data-sort].asc::after {
    content: ' ↑';
    color: #00d4ff;
}

th[data-sort].desc::after {
    content: ' ↓';
    color: #00d4ff;
}
