* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #111827;
    color: #ffffff;
    min-height: 100vh;
    padding: 1.5rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.selection-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.selection-content {
    max-width: 1000px;
    width: 100%;
}

.header-section {
    text-align: center;
    margin-bottom: 3rem;
}

.header-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: #8B5CF6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.subtitle {
    color: #9CA3AF;
    font-size: 1.125rem;
}

.coin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.coin-card {
    background: #1F2937;
    border: 2px solid transparent;
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.coin-card:hover {
    transform: scale(1.05);
    border-color: #8B5CF6;
    background: #374151;
}

.coin-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.coin-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.coin-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.coin-symbol {
    color: #9CA3AF;
    font-size: 0.875rem;
}

.info-box {
    background: #1F2937;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 3rem;
}

.info-box h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.info-box ul {
    list-style: none;
    color: #D1D5DB;
    font-size: 0.875rem;
}

.info-box li {
    margin-bottom: 0.5rem;
}

.analysis-screen {
    display: none;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.back-btn {
    background: #1F2937;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.back-btn:hover {
    background: #374151;
}

.refresh-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn:hover {
    opacity: 0.8;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #374151;
    border-top-color: #8B5CF6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.card {
    background: #1F2937;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.price-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-value {
    font-size: 3rem;
    font-family: monospace;
    font-weight: bold;
}

.change-value {
    font-size: 2.5rem;
    font-weight: bold;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: #1F2937;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.metric-label {
    color: #9CA3AF;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2.5rem;
    font-family: monospace;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.metric-desc {
    color: #9CA3AF;
    font-size: 0.875rem;
}

.alert {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #EF4444;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.alert.medium {
    background: rgba(251, 191, 36, 0.1);
    border-left-color: #FBBF24;
}

.alert-type {
    font-size: 0.75rem;
    background: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.alert-message {
    font-size: 0.875rem;
    color: #D1D5DB;
}

.no-alerts {
    text-align: center;
    padding: 3rem;
    color: #9CA3AF;
}

.info-section {
    background: #1F2937;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.info-grid p {
    color: #D1D5DB;
    font-size: 0.875rem;
    line-height: 1.6;
}

.info-grid strong {
    color: white;
}

.prediction-card {
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
    border: 2px solid #4B5563;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.prediction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8B5CF6, #EC4899);
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.prediction-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.prediction-direction {
    text-align: center;
}

.direction-label {
    font-size: 0.875rem;
    color: #9CA3AF;
    margin-bottom: 0.5rem;
}

.direction-value {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.direction-icon {
    font-size: 2rem;
}

.confidence-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.confidence-bar {
    position: relative;
}

.confidence-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.bar-container {
    width: 100%;
    height: 24px;
    background: #374151;
    border-radius: 12px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.bar-up {
    background: linear-gradient(90deg, #34D399, #10B981);
}

.bar-down {
    background: linear-gradient(90deg, #EF4444, #DC2626);
}

.training-status {
    text-align: center;
    padding: 1rem;
    background: #374151;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #9CA3AF;
}

.training-status.training {
    background: #1F2937;
    border: 1px dashed #8B5CF6;
}

.nn-info {
    font-size: 0.75rem;
    color: #6B7280;
    margin-top: 1rem;
    text-align: center;
}

.hidden {
    display: none;
}

canvas {
    max-width: 100%;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    /* Coin grid - single column on mobile */
    .coin-grid {
        grid-template-columns: 1fr;
    }

    /* Price card - stack vertically on mobile */
    .price-card {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .price-card > div {
        width: 100%;
    }

    .price-value {
        font-size: 2rem;
    }

    .change-value {
        font-size: 1.75rem;
    }

    /* Metrics grid - single column on mobile */
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-value {
        font-size: 2rem;
    }

    /* Analysis header - stack on mobile */
    .analysis-header {
        flex-direction: column;
        align-items: stretch;
    }

    .back-btn, .refresh-btn {
        width: 100%;
        justify-content: center;
    }

    /* Prediction card */
    .prediction-main {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .direction-value {
        font-size: 2.5rem;
    }

    /* Stats container */
    #statsContainer > div {
        grid-template-columns: 1fr !important;
    }

    /* Card padding */
    .card {
        padding: 1rem;
    }

    .metric-card {
        padding: 1rem;
    }

    /* Info section */
    .info-grid {
        grid-template-columns: 1fr !important;
    }

    /* Reduce chart height on mobile */
    canvas {
        max-height: 250px;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .price-card {
        flex-direction: row;
    }

    .prediction-main {
        grid-template-columns: 1fr 1fr;
    }
}