/* ============================================
   YoursFarmFully — Detail Page Styles
   ============================================ */

:root { --detail-accent: #3a8a56; }

/* Detail Hero */
.detail-hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    padding: 80px 0 48px;
    overflow: hidden;
}

.detail-hero-bg { position: absolute; inset: 0; }

.detail-hero-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: brightness(0.25) saturate(0.6);
}

.detail-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10,15,10,0.3) 0%, rgba(10,15,10,0.8) 60%, rgba(10,15,10,1) 100%);
}

.detail-hero-particles {
    position: absolute; inset: 0;
    pointer-events: none; overflow: hidden;
}

.detail-particle {
    position: absolute;
    border-radius: 50%;
    animation: floatParticle 8s ease-in-out infinite;
}

@keyframes floatParticle {
    0%,100% { transform: translate(0,0); }
    50% { transform: translate(10px,-20px); }
}

.detail-hero-content {
    position: relative; z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 40px;
    justify-content: space-between;
}

.detail-hero-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.detail-back {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    transition: color 0.3s;
}
.detail-back:hover { color: var(--detail-accent); }

.detail-hero-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    max-width: 700px;
}

.detail-hero-subtitle {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 600px;
}

.detail-hero-ring {
    position: relative;
    flex-shrink: 0;
    width: 130px; height: 130px;
    margin-bottom: 10px;
}

.detail-hero-ring svg { width: 100%; height: 100%; filter: drop-shadow(0 0 20px var(--detail-accent)); }

.detail-ring-label {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono);
    font-size: 22px; font-weight: 700;
    color: var(--text-primary);
}

/* Stats Bar */
.detail-stats-bar {
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 20px 0;
}

.detail-stats {
    display: flex; align-items: center; justify-content: center;
    gap: 24px; flex-wrap: wrap;
}

.detail-stat { text-align: center; }
.ds-value { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.ds-label { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.ds-divider { width: 1px; height: 32px; background: var(--border); }

/* Main Layout */
.detail-main { padding: 64px 0; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    align-items: start;
}

/* Content Sections */
.detail-section { margin-bottom: 56px; }

.detail-section-title {
    font-family: var(--font-display);
    font-size: 24px; font-weight: 700;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 12px;
}

.detail-section-num {
    font-family: var(--font-mono);
    font-size: 14px; font-weight: 600;
    color: var(--detail-accent);
    opacity: 0.5;
}

.detail-text {
    font-size: 15px; line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Image Block */
.detail-image-block {
    border-radius: 16px; overflow: hidden;
    margin: 24px 0;
    border: 1px solid var(--border);
}

.detail-image-block img {
    width: 100%; height: 280px;
    object-fit: cover;
    filter: brightness(0.8);
}

.detail-img-caption {
    display: block;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

/* Formula Card */
.detail-formula-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin: 24px 0;
}

.formula-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--border);
    font-size: 13px; font-weight: 600;
    color: var(--detail-accent);
}

.formula-card-body { padding: 24px; }

.formula-main {
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--green-300);
    padding: 20px;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.04);
    text-shadow: 0 0 30px rgba(74,222,128,0.2);
    line-height: 1.6;
    overflow-x: auto;
}

.fw-item {
    display: flex; gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
}
.fw-item:last-child { border: none; }
.fw-symbol { font-family: var(--font-mono); font-weight: 600; min-width: 80px; flex-shrink: 0; }
.fw-desc { color: var(--text-secondary); }

/* Benefits */
.detail-benefits { display: flex; flex-direction: column; gap: 16px; }

.benefit-card {
    display: flex; gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    transition: all 0.3s var(--ease-out);
}
.benefit-card:hover { border-color: var(--border-hover); transform: translateX(4px); }

.benefit-num {
    font-family: var(--font-mono);
    font-size: 24px; font-weight: 700;
    opacity: 0.3; flex-shrink: 0;
    line-height: 1;
}

.benefit-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.benefit-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* Chart Card */
.detail-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.chart-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.chart-title { font-size: 14px; font-weight: 600; }
.chart-period { font-size: 12px; color: var(--text-muted); }

.chart-body { padding: 20px; }
.main-chart { width: 100%; height: 200px; }

.chart-legend {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-secondary);
}
.chart-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* Ranges */
.detail-ranges { display: flex; flex-direction: column; gap: 16px; }

.range-item {
    display: flex; gap: 16px; align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.range-bar-track { width: 6px; height: 48px; background: rgba(255,255,255,0.06); border-radius: 3px; flex-shrink: 0; overflow: hidden; }
.range-bar-fill { width: 100%; border-radius: 3px; height: 100%; }

.range-header { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.range-value { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.range-label { font-size: 14px; font-weight: 600; }
.range-desc { font-size: 12px; color: var(--text-muted); }

/* Sidebar */
.detail-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 16px; }

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

.sidebar-card h3 {
    font-size: 14px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Key Facts */
.kf-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 8px 0;
    font-size: 13px; color: var(--text-secondary); line-height: 1.5;
}
.kf-item svg { flex-shrink: 0; margin-top: 2px; }

/* Sidebar Images */
.sidebar-related-img { padding: 0; overflow: hidden; }
.sidebar-related-img img {
    width: 100%; height: 180px;
    object-fit: cover; filter: brightness(0.7);
    transition: all 0.4s;
}
.sidebar-related-img:hover img { filter: brightness(0.85); transform: scale(1.03); }
.sidebar-img-caption {
    padding: 12px 16px;
    font-size: 12px; color: var(--text-muted);
}

/* Applications Tags */
.app-tag {
    display: inline-block;
    font-size: 12px; padding: 4px 12px;
    border: 1px solid; border-radius: 100px;
    margin: 0 6px 8px 0;
}

/* Data Sources */
.ds-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0; font-size: 13px; color: var(--text-secondary);
}

/* Other Indices */
.sidebar-other-grid { display: flex; flex-direction: column; gap: 6px; }

.other-index-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    transition: all 0.25s;
    font-size: 13px;
}
.other-index-link:hover { border-color: var(--oi-color); background: rgba(0,0,0,0.4); }

.oi-abbr {
    font-family: var(--font-mono); font-weight: 700;
    font-size: 11px; color: var(--oi-color);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px; border-radius: 4px;
    min-width: 52px; text-align: center;
}
.oi-name { color: var(--text-secondary); font-size: 12px; }

/* Detail CTA */
.detail-cta {
    padding: 60px 0;
    background: var(--bg-secondary);
}

.detail-cta-block {
    text-align: center;
    background: linear-gradient(135deg, var(--green-800), var(--green-900));
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 20px;
    padding: 48px;
}
.detail-cta-block h2 { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.detail-cta-block p { color: rgba(255,255,255,0.7); font-size: 15px; margin-bottom: 24px; }

/* Responsive */
@media (max-width: 1024px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; display: grid; grid-template-columns: repeat(2, 1fr); }
    .detail-hero-content { flex-direction: column; align-items: flex-start; }
    .detail-hero-ring { width: 90px; height: 90px; order: -1; }
    .detail-ring-label { font-size: 16px; }
}

@media (max-width: 768px) {
    .detail-hero { min-height: 400px; }
    .detail-sidebar { grid-template-columns: 1fr; }
    .detail-stats { gap: 16px; }
    .ds-divider { display: none; }
    .formula-main { font-size: 14px; }
    .detail-cta-block { padding: 32px 20px; }
}

@media (max-width: 480px) {
    .detail-hero { min-height: 350px; padding: 70px 0 32px; }
    .fw-item { flex-direction: column; gap: 4px; }
    .fw-symbol { min-width: auto; }
}
