@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

:root {
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #03dac6;
    --on-surface-color: #ffffff;
    --on-surface-secondary-color: #b3b3b3;
    --success-color: #4caf50;
    --danger-color: #e94545;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --secondary-color: #9e9e9e;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--on-surface-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1080px;
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.3s ease;
}


.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid #333;
    padding-bottom: 16px;
}

.header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary-color);
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.last-updated {
    color: var(--on-surface-secondary-color);
    font-size: 0.8rem;
    margin-left: 16px;
}

.status-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--warning-color);
    /* animation: pulse 2s infinite; */
}

.status-light.connected {
    background-color: var(--success-color);
    /* animation: pulse-green 2s infinite; */
}

.status-light.error {
    background-color: var(--danger-color);
    /* animation: pulse-red 2s infinite; */
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
    }
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(3, 218, 198, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(3, 218, 198, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(3, 218, 198, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

.summary {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: center;
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.trend-group {
    flex: 1;
}

.summary h2 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.summary .trend {
    font-size: 1.5rem;
    font-weight: 700;
}

.trend.uptrend {
    color: var(--success-color);
}

.trend.downtrend {
    color: var(--danger-color);
}

.trend.sideways {
    color: var(--warning-color);
}

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

.timeframes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.timeframe-card {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-header .suggestion {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.score-bar-container {
    width: 100%;
    height: 8px;
    background-color: #444;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.score-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-in-out, background-color 0.5s ease;
}

.timeframe-label {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.score {
    font-size: 0.9rem;
    color: var(--on-surface-secondary-color);
}

.card-body .status-label {
    font-size: 1rem;
    margin-bottom: 8px;
}

.card-body .suggestion {
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
}

.suggestion.buy {
    background-color: var(--success-color);
}

.suggestion.sell {
    background-color: var(--danger-color);
}

.suggestion.hold {
    background-color: #607d8b;
}

.suggestion.avoid {
    background-color: #607d8b;
}

.reason {
    font-size: 0.8rem;
    color: var(--on-surface-secondary-color);
    margin-top: 8px;
}

.loader, .error-message {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 16px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

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