/* Metal Analyzer Premium Styles (Final Refined Integration) */

:root {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    --trend-bull: #10b981;
    --trend-bear: #ef4444;
    --trend-range: #6b7280;
    --trend-risk: #f59e0b;
    
    --score-bg: rgba(0, 0, 0, 0.05);
    --chart-bg: #0b0e11;
}

body {
    background: linear-gradient(135deg, #f0f4f8 0%, #d7e2eb 100%);
    background-attachment: fixed;
}

.updated-time {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -10px 0 30px 0;
    font-family: 'Inter', sans-serif;
}

/* Summary Section */
.summary-section {
    margin-bottom: 40px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.summary-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.summary-card h3 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-card .prediction {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

.summary-card .details {
    font-size: 0.9rem;
    color: var(--text-main);
    background: rgba(255,255,255,0.4);
    padding: 12px;
    border-radius: 12px;
    border-left: 4px solid var(--brand-green);
}

.summary-card.short .details { border-left-color: var(--trend-bull); }
.summary-card.middle .details { border-left-color: var(--brand-orange); }
.summary-card.long .details { border-left-color: var(--brand-green); }

/* Glassmorphism Cards (Details) */
.details-section {
    margin-top: 40px;
    border-top: 2px solid rgba(0,0,0,0.05);
    padding-top: 40px;
    text-align: left;
}

.details-grid {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.tf-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.tf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tf-name {
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--brand-green);
}

.tf-trend-badge {
    font-size: 1rem;
    padding: 6px 16px;
    border-radius: 12px;
    font-weight: 800;
}

.tf-trend-bull { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.tf-trend-bear { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }
.tf-trend-range { background: #f3f4f6; color: #374151; border: 1px solid #9ca3af; }

.tf-chart-pane {
    width: calc(100% + 60px);
    margin-left: -30px;
    margin-right: -30px;
    margin-bottom: 30px;
    background: var(--chart-bg);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.tf-chart-pane img {
    width: 100%;
    height: auto;
    display: block;
}

.tf-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.tf-metric-tile {
    background: rgba(255, 255, 255, 0.4);
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.tf-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tf-metric-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }
.tf-metric-value { font-weight: 800; font-size: 1rem; }

.tf-tile-bar-bg { height: 6px; background: var(--score-bg); border-radius: 3px; overflow: hidden; }
.tf-tile-bar-fill { height: 100%; transition: width 1s ease; border-radius: 3px; }

.bullish-bar { background: var(--trend-bull); }
.bearish-bar { background: var(--trend-bear); }
.momentum-bar { background: var(--brand-green); }
.volatility-bar { background: var(--trend-range); }
.risk-bar { background: var(--trend-risk); }

.tf-reversal {
    font-size: 1rem;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    border-left: 6px solid var(--brand-orange);
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 640px) {
    .summary-grid { grid-template-columns: 1fr; }
    .tf-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .tf-chart-pane { width: calc(100% + 40px); margin-left: -20px; margin-right: -20px; }
    .tf-card { padding: 20px; }
}
