/* CSS Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0a1628;
    --bg-secondary: #0f1d32;
    --bg-card: #152238;
    --bg-card-hover: #1a2a45;
    --border-color: #1e3a5f;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-green: #22c55e;
    --accent-green-light: #4ade80;
    --accent-red: #ef4444;
    --accent-yellow: #eab308;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --gradient-green: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-green);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-yellow);
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--accent-green);
}

.status-dot.offline {
    background: var(--accent-red);
    animation: none;
}

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

.status-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero .highlight {
    color: var(--accent-green);
}

.hero .subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Prediction Section */
.prediction-section {
    margin-bottom: 2rem;
}

.prediction-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.prediction-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
}

.prediction-body {
    display: grid;
    gap: 1.5rem;
}

.price-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.price-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.price-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.price-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.actual-price .price-value {
    color: var(--accent-blue);
}

.predicted-price .price-value {
    color: var(--accent-green);
}

.price-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.price-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.confidence-badge {
    font-size: 0.875rem;
    color: var(--accent-green);
    background: rgba(34, 197, 94, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

.prediction-range {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.range-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.range-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.range-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.range-value.high {
    color: var(--accent-green);
}

.range-value.low {
    color: var(--accent-red);
}

.range-value.spread {
    color: var(--accent-yellow);
}

/* Analysis Section */
.analysis-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.analysis-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.analysis-card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.analysis-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.analysis-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent-blue);
}

.direction-icon.bullish svg {
    color: var(--accent-green);
    transform: rotate(0deg);
}

.direction-icon.bearish svg {
    color: var(--accent-red);
    transform: rotate(180deg);
}

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

.analysis-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analysis-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Features Section */
.features-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.feature-card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-green);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Sources Section */
.sources-section {
    text-align: center;
    margin-bottom: 2rem;
}

.sources-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.source-badge {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-meta {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .price-value {
        font-size: 2.25rem;
    }

    .prediction-range {
        grid-template-columns: 1fr;
    }

    .analysis-section {
        grid-template-columns: 1fr 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .price-display {
        grid-template-columns: 1fr;
    }

    .analysis-section {
        grid-template-columns: 1fr;
    }

    .stats-section {
        grid-template-columns: 1fr 1fr;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Market Hours Indicator */
.market-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.market-status.open {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

.market-status.closed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}


/* Prediction Selector */
.prediction-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.prediction-dropdown {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prediction-dropdown:hover {
    border-color: var(--accent-green);
}

.prediction-dropdown:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.prediction-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.date-picker-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date-input {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-family: var(--font-family);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.date-input:hover {
    border-color: var(--accent-green);
}

.date-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* Chrome/Edge date picker styling */
.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.get-prediction-btn {
    background: var(--gradient-green);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.get-prediction-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.get-prediction-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments for prediction selector */
@media (max-width: 768px) {
    .prediction-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .date-picker-container {
        flex-wrap: wrap;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
