/* TradingView Charts - Professional Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 20px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffd700;
    transform: translateY(-2px);
}

.control-btn.active {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1e3c72;
    border-color: #ffd700;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.chart-container {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-height: 700px;
    display: flex;
    flex-direction: column;
}

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.chart-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chart-wrapper {
    height: 600px;
    min-height: 600px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.analysis-section {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.analysis-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #ffd700;
    text-align: center;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.coin-analysis {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #ffd700;
}

.coin-analysis h3 {
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.analysis-points {
    list-style: none;
}

.analysis-points li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.analysis-points li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #ffd700;
}

.timeframe-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.timeframe-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.timeframe-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.timeframe-btn.active {
    background: #ffd700;
    color: #1e3c72;
    border-color: #ffd700;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 20px;
    }
    
    .chart-wrapper {
        height: 500px;
        min-height: 500px;
    }
    
    .tradingview-widget-container {
        min-height: 500px !important;
    }
    
    .tradingview-widget-container iframe {
        min-height: 500px !important;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
    min-height: 600px;
    font-size: 1.2rem;
    color: #ffd700;
    width: 100%;
}

.loading:after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 15px;
}

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

/* Chart specific styling */
.tradingview-widget-container {
    height: 100% !important;
    width: 100% !important;
    min-height: 600px;
    position: relative;
    flex: 1;
}

.tradingview-widget-container iframe {
    border-radius: 8px;
    width: 100% !important;
    height: 600px !important;
    min-height: 600px !important;
    border: none;
}

/* Force proper sizing for all TradingView elements */
div[id$="-chart"] {
    height: 600px !important;
    min-height: 600px !important;
    width: 100% !important;
}

/* Ensure charts are visible and properly sized */
.chart-wrapper > div {
    height: 100% !important;
    width: 100% !important;
}

/* Price Ticker Styles */
.price-ticker {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 0;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.ticker-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ticker-symbol {
    font-weight: 600;
    color: #ffd700;
    font-size: 1.1rem;
}

.ticker-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
}

.ticker-change {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.ticker-change.positive {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.ticker-change.negative {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

/* Real-time Analysis Styles */
.realtime-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.analysis-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.analysis-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.analysis-card h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.analysis-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid #ffd700;
}

.metric-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.metric-value {
    font-weight: 600;
    color: #ffffff;
}

.metric-value.bullish {
    color: #00ff88;
}

.metric-value.bearish {
    color: #ff4757;
}

.metric-value.neutral {
    color: #ffd700;
}

.trading-signals {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.trading-signals h4 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1rem;
}

.signals-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.signal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.signal-item.buy {
    background: rgba(0, 255, 136, 0.1);
    border-left: 3px solid #00ff88;
    color: #00ff88;
}

.signal-item.sell {
    background: rgba(255, 71, 87, 0.1);
    border-left: 3px solid #ff4757;
    color: #ff4757;
}

.signal-item.neutral {
    background: rgba(255, 215, 0, 0.1);
    border-left: 3px solid #ffd700;
    color: #ffd700;
}

.signal-strength {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Price Alert Styles */
.alert-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-section h3 {
    color: #ffd700;
    margin-bottom: 20px;
    text-align: center;
}

.alert-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.alert-controls select,
.alert-controls input {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
}

.alert-controls select:focus,
.alert-controls input:focus {
    outline: none;
    border-color: #ffd700;
}

.alert-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1e3c72;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.active-alerts h4 {
    color: #ffd700;
    margin-bottom: 15px;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #ffd700;
}

.alert-remove {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.alert-remove:hover {
    background: rgba(255, 71, 87, 0.4);
}

/* Notification Styles */
.price-alert-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 15px;
    max-width: 300px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #ffd700;
    font-weight: 600;
}

.alert-header button {
    background: none;
    border: none;
    color: #ffd700;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
}

.alert-body {
    color: white;
    margin-bottom: 8px;
    line-height: 1.4;
}

.alert-time {
    color: #aaa;
    font-size: 0.8rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Updates */
@media (max-width: 768px) {
    .realtime-analysis {
        grid-template-columns: 1fr;
    }
    
    .analysis-metrics {
        grid-template-columns: 1fr;
    }
    
    .ticker-container {
        gap: 20px;
    }
    
    .alert-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .price-alert-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}