* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #4ade80, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

#scanBtn, #refreshBtn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

#scanBtn:hover, #refreshBtn:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

#scanBtn:disabled, #refreshBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#scanIcon.scanning, #refreshIcon.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#lastUpdate {
    color: #64748b;
    font-size: 0.9rem;
}

#error-message {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #374151;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.stocks-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stock-card {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid #374151;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.stock-card:hover {
    border-color: #4b5563;
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.stock-info h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.stock-info p {
    color: #9ca3af;
    font-size: 0.9rem;
}

.stock-price {
    text-align: right;
}

.price {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.change {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 4px;
}

.positive {
    color: #4ade80;
}

.negative {
    color: #f87171;
}

.metric-box {
    background: #374151;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 0.9rem;
    color: #d1d5db;
}

.metric-value {
    font-weight: bold;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #4b5563;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.growth-positive {
    background: #4ade80;
}

.growth-negative {
    background: #f87171;
}

.risk-low {
    background: #4ade80;
}

.risk-medium {
    background: #fbbf24;
}

.risk-high {
    background: #f87171;
}

.stock-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 12px;
}

.ranking {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
    margin-top: 8px;
}

footer {
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    border-top: 1px solid #374151;
    padding-top: 20px;
}

footer p {
    margin-bottom: 8px;
}

.warning {
    color: #fbbf24 !important;
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .stocks-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .controls {
        flex-direction: column;
        gap: 12px;
    }
}