/*
Theme Name: Portal Pangan
Theme URI: https://www.anakmedan.id
Description: Tema khusus Portal Pangan Medan & Sumatera Utara. Fokus pada harga pangan, berita pertanian, dan data pasar.
Version: 1.0.1
Author: Portal Pangan
Author URI: https://www.anakmedan.id
Text Domain: portal-pangan
Tags: custom-background, custom-header, e-commerce, featured-images, full-width-template, mobile-first, pwa, responsive
*/

:root {
    --primary: #18345f;
    --primary-dark: #102542;
    --accent: #d97706;
    --accent-dark: #b45300;
    --text: #1a1a1a;
    --text-light: #666666;
    --bg: #ffffff;
    --bg-light: #f8fafc;
    --border: #e2e8f0;
    --danger: #dc2626;
    --success: #16a34a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--primary);
    color: white;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 22px;
    font-weight: 700;
}

.site-title a {
    color: white;
    text-decoration: none;
}

.site-description {
    font-size: 12px;
    opacity: 0.8;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 24px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 0;
    transition: opacity 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    opacity: 0.7;
    border-bottom: 2px solid var(--accent);
}

.search-box {
    display: flex;
    margin-top: 15px;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: 600;
}

.nav-categories {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.nav-categories a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.nav-categories a:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #18345f, #334155);
    color: white;
    padding: 40px 0;
    margin-bottom: 20px;
}

.hero .hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.hero-card {
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.hero-card h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.hero-card a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* Price Section */
.price-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.price-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-section-title .icon {
    font-size: 20px;
}

/* Price Grid */
.pp-price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.pp-price-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.pp-commodity {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.pp-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-dark);
}

.pp-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

.pp-up { color: var(--danger); }
.pp-down { color: var(--success); }
.pp-neutral { color: var(--text-light); }

/* Trend Radar */
.trend-radar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.trend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 6px;
}

.trend-name {
    font-size: 14px;
    font-weight: 500;
}

.trend-change {
    font-size: 13px;
    font-weight: 700;
}

/* Breaking News */
.breaking-news {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.breaking-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.breaking-item {
    margin-bottom: 8px;
}

.breaking-item:last-child {
    margin-bottom: 0;
}

.breaking-item strong {
    font-size: 14px;
    display: block;
}

.breaking-item small {
    font-size: 11px;
    opacity: 0.8;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .news-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.news-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.news-card-content {
    padding: 15px;
}

.news-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.news-card-title a {
    color: inherit;
    text-decoration: none;
}

.news-card-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 10px;
}

.news-card-excerpt {
    font-size: 14px;
    color: var(--text-light);
    margin: 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Video Section */
.video-section {
    margin-bottom: 20px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.video-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--primary);
}

.video-card::before {
    content: '';
    display: block;
    padding-top: 56.25%;
}

.video-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 40px 12px 12px;
    font-size: 11px;
}

/* Analysis */
.analysis-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid var(--accent);
}

.analysis-card h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.analysis-card p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
}

/* Footer */
.site-footer {
    background: var(--primary-dark);
    color: white;
    padding: 40px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 8px;
}

.footer-widget a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
}

.footer-widget a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 15px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

/* PWA install button */
.pwa-install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Mobile */
@media (max-width: 768px) {
    .container { padding: 0 15px; }
    .header-top { flex-direction: column; align-items: flex-start; gap: 10px; }
    .main-nav ul { flex-wrap: wrap; gap: 12px; }
    .hero { padding: 20px 0; }
    .hero-card { padding: 15px; }
    .trend-grid { grid-template-columns: 1fr; }
    .video-grid { grid-template-columns: 1fr; }
    .news-grid { grid-template-columns: 1fr; }
    .price-section { padding: 15px; }
    .pp-price-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .pp-price-item { padding: 10px; }
    .pp-price { font-size: 14px; }
    .nav-categories { display: none; }
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Trust indicators */
.trust-bar {
    background: var(--bg-light);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-light);
}

.trust-bar span {
    margin-right: 20px;
}

.trust-bar .verified {
    color: var(--success);
    font-weight: 500;
}

/* Commodity page */
.commodity-header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}

.commodity-header h1 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 10px;
}

.commodity-price-big {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-dark);
    margin: 10px 0;
}

.commodity-change {
    font-size: 18px;
    font-weight: 600;
}

.commodity-meta {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 10px;
}

/* Market tabs */
.market-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.market-tabs button {
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
}

.market-tabs button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Correction notice */
.correction-notice {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 13px;
}
