/**
 * Crypto AI Dashboard - Frontend Styles
 */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --accent-blue: #3498db;
    --accent-green: #2ecc71;
    --accent-red: #e74c3c;
    --accent-yellow: #f39c12;
    --accent-purple: #9b59b6;
    --border-color: #2a2a4a;
    --card-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.crypto-dashboard-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
}

.crypto-dashboard-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Header */
.crypto-dashboard-header {
    text-align: center;
    padding: 30px 20px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
}

.crypto-dashboard-header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.crypto-dashboard-status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

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

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

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

/* Market Overview */
.crypto-dashboard-market-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.crypto-dashboard-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.crypto-dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.crypto-dashboard-card-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.crypto-dashboard-card-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.crypto-dashboard-card-change {
    font-size: 0.9rem;
    margin-top: 5px;
}

.crypto-dashboard-positive { color: var(--accent-green); }
.crypto-dashboard-negative { color: var(--accent-red); }
.crypto-dashboard-neutral { color: var(--accent-yellow); }

/* Section Titles */
.crypto-dashboard-section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.crypto-dashboard-section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--accent-blue);
    border-radius: 2px;
}

/* Coins Grid */
.crypto-dashboard-coins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.crypto-dashboard-coin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.crypto-dashboard-coin-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-3px);
}

.crypto-dashboard-coin-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.crypto-dashboard-coin-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.crypto-dashboard-coin-info h3 {
    font-size: 1.2rem;
    margin-bottom: 3px;
}

.crypto-dashboard-coin-info span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.crypto-dashboard-coin-price {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.crypto-dashboard-coin-changes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.crypto-dashboard-change-item {
    text-align: center;
    padding: 8px;
    background: var(--bg-card);
    border-radius: 8px;
}

.crypto-dashboard-change-item small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.crypto-dashboard-signal-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.crypto-dashboard-signal-buy { background: rgba(46, 204, 113, 0.2); color: var(--accent-green); }
.crypto-dashboard-signal-sell { background: rgba(231, 76, 60, 0.2); color: var(--accent-red); }
.crypto-dashboard-signal-hold { background: rgba(243, 156, 18, 0.2); color: var(--accent-yellow); }

.crypto-dashboard-coin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-size: 0.85rem;
}

.crypto-dashboard-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

.crypto-dashboard-stat-label { color: var(--text-secondary); }
.crypto-dashboard-stat-value { font-weight: 600; }

/* Signals */
.crypto-dashboard-signals-list {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.crypto-dashboard-signal-item {
    background: var(--bg-secondary);
    border-left: 4px solid;
    border-radius: 10px;
    padding: 15px;
}

.crypto-dashboard-signal-item.buy { border-left-color: var(--accent-green); }
.crypto-dashboard-signal-item.sell { border-left-color: var(--accent-red); }
.crypto-dashboard-signal-item.hold { border-left-color: var(--accent-yellow); }

/* News */
.crypto-dashboard-news-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.crypto-dashboard-news-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.crypto-dashboard-news-sentiment {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.crypto-dashboard-news-content {
    flex: 1;
}

.crypto-dashboard-news-content h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.crypto-dashboard-news-content small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Charts */
.crypto-dashboard-chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.crypto-dashboard-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.crypto-dashboard-timeframe-buttons {
    display: flex;
    gap: 5px;
}

.crypto-dashboard-tf-btn {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.crypto-dashboard-tf-btn:hover,
.crypto-dashboard-tf-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Loading */
.crypto-dashboard-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.crypto-dashboard-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error */
.crypto-dashboard-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    color: var(--accent-red);
}

/* Alerts */
.crypto-dashboard-alerts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.crypto-dashboard-alert-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
}

.crypto-dashboard-alert-card.pump { border-left: 4px solid var(--accent-green); }
.crypto-dashboard-alert-card.dump { border-left: 4px solid var(--accent-red); }

/* Modal */
.crypto-dashboard-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.crypto-dashboard-modal.active { display: flex; }

.crypto-dashboard-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.crypto-dashboard-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.crypto-dashboard-close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .crypto-dashboard-header h1 { font-size: 1.8rem; }
    .crypto-dashboard-market-overview { grid-template-columns: 1fr; }
    .crypto-dashboard-coins-grid { grid-template-columns: 1fr; }
    .crypto-dashboard-coin-changes { grid-template-columns: repeat(3, 1fr); }
    .crypto-dashboard-status-bar { flex-direction: column; }
}

/* Light Mode */
@media (prefers-color-scheme: light) {
    .crypto-dashboard-container {
        --bg-primary: #f5f5f5;
        --bg-secondary: #ffffff;
        --bg-card: #e8e8e8;
        --text-primary: #333333;
        --text-secondary: #666666;
        --border-color: #dddddd;
        --card-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    }
}

/* Telegram Button */
.crypto-dashboard-telegram-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #0088cc;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s;
}

.crypto-dashboard-telegram-btn:hover {
    background: #0077b5;
}

/* Fear & Greed Gauge */
.crypto-dashboard-fg-gauge {
    width: 200px;
    height: 100px;
    margin: 0 auto;
    position: relative;
}

.crypto-dashboard-fg-value {
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    margin-top: -20px;
}

.crypto-dashboard-fg-label {
    text-align: center;
    font-size: 1.2rem;
    margin-top: 10px;
}
