/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Header */
header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2563eb;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    transition: background-color 0.3s ease;
}

.status-dot.connected {
    background: #10b981;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 2rem 0;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.refresh-btn:hover {
    background: #1d4ed8;
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Market overview */
.market-overview {
    margin-bottom: 2rem;
}

.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.overview-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.overview-card h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overview-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.overview-change {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Crypto grid */
.crypto-section {
    margin-bottom: 2rem;
}

.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.crypto-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.crypto-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.crypto-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.crypto-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.crypto-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.crypto-symbol {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
}

.crypto-rank {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.crypto-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.crypto-change {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.price-up {
    color: #059669;
    background: #d1fae5;
}

.price-down {
    color: #dc2626;
    background: #fee2e2;
}

.crypto-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.875rem;
}

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

.stat-label {
    color: #6b7280;
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.stat-value {
    color: #1f2937;
    font-weight: 500;
}

/* Loading and error states */
.loading-state, .error-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 2rem 0;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-left: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.error-state p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.retry-btn:hover {
    background: #b91c1c;
}

/* Footer */
footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.footer-content a {
    color: #2563eb;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

.footer-content p:first-child {
    margin-bottom: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }
    
    main {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .overview-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .crypto-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .overview-cards {
        grid-template-columns: 1fr;
    }
    
    .crypto-card {
        padding: 1rem;
    }
}
