/* Hero Section */
.hero-wrapper { 
    position: relative; 
    margin-bottom: 1rem;
}

.hero-image { 
    position: relative; 
    height: 400px; 
    border-radius: 16px; 
    overflow: hidden; 
}

.hero-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.hero-overlay { 
    position: absolute; 
    inset: 0; 
    background: rgba(0,0,0,0.6); 
}

.hero-content { 
    position: absolute; 
    top: 50%; 
    left: 50px; 
    transform: translateY(-50%); 
    z-index: 2; 
}

.hero-title { 
    font-size: 3.5rem; 
    font-weight: 800; 
    color: white; 
    line-height: 1.1; 
    margin: 0; 
}

.hero-subtitle { 
    font-size: 1.2rem; 
    color: rgba(255,255,255,0.9); 
    margin-top: 1rem; 
}

/* Info Card Overlay */
.info-card-overlay { 
    position: absolute; 
    bottom: -50px; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 90%; 
    max-width: 900px; 
    z-index: 3; 
    background: white; 
    border-radius: 16px; 
    padding: 2rem; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); 
}

.info-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 2rem; 
}

.info-item { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
}

.info-icon { 
    width: 50px; 
    height: 50px; 
    background: #10b981;
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    font-size: 24px; 
    flex-shrink: 0;
}

.info-content { 
    flex: 1; 
    min-width: 0;
}

.info-label { 
    display: block; 
    font-size: 0.85rem; 
    color: #6c757d; 
    margin-bottom: 4px; 
}

.info-value { 
    display: block; 
    font-size: 1.1rem; 
    font-weight: 600; 
    color: #1a1a1a; 
}

/* Section Header */
.section-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 2rem; 
    margin-top: 4rem; 
}

.section-badge { 
    display: inline-block; 
    padding: 6px 16px; 
    background: #10b981;
    color: white; 
    border-radius: 20px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    margin-bottom: 0.5rem; 
}

.section-title { 
    font-size: 2rem; 
    font-weight: 700; 
    color: #1a1a1a; 
    margin: 0.5rem 0; 
}

.section-description { 
    color: #6c757d; 
    font-size: 1rem; 
    margin-top: 0.5rem; 
}

.section-actions { 
    display: flex; 
    gap: 1rem; 
    align-items: center; 
}

/* Filter Dropdown */
.filter-dropdown { 
    position: relative; 
}

.filter-btn { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    padding: 12px 20px; 
    background: white; 
    border: 2px solid #e9ecef; 
    border-radius: 10px; 
    font-size: 0.95rem; 
    font-weight: 500; 
    color: #495057; 
    cursor: pointer; 
    transition: all 0.3s; 
}

.filter-btn:hover { 
    border-color: #10b981;
    background: #f8f9fa; 
}

.filter-btn.active { 
    border-color: #10b981;
    background: #f0fdf4;
}

.dropdown-menu { 
    position: absolute; 
    top: 100%; 
    right: 0; 
    margin-top: 8px; 
    min-width: 220px; 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.1); 
    padding: 8px; 
    z-index: 1000; 
    display: none; 
}

.dropdown-menu.show { 
    display: block; 
}

.dropdown-item { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 12px 16px; 
    color: #495057; 
    text-decoration: none; 
    border-radius: 8px; 
    transition: all 0.2s; 
    font-size: 0.95rem; 
}

.dropdown-item:hover { 
    background: #f8f9fa; 
    color: #10b981;
}

.dropdown-item.active { 
    background: #10b981;
    color: white; 
}

/* Refresh Button */
.btn-refresh { 
    width: 48px; 
    height: 48px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: white; 
    border: 2px solid #e9ecef; 
    border-radius: 10px; 
    color: #495057; 
    cursor: pointer; 
    transition: all 0.3s; 
    font-size: 20px; 
}

.btn-refresh:hover { 
    border-color: #10b981;
    color: #10b981;
    transform: rotate(90deg); 
}

.btn-refresh.spinning { 
    animation: spin 1s linear; 
}

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

/* Loading State */
.loading-state { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 4rem 2rem; 
}

.spinner { 
    width: 50px; 
    height: 50px; 
    border: 4px solid #f3f3f3; 
    border-top: 4px solid #10b981;
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
}

.loading-state p { 
    margin-top: 1rem; 
    color: #6c757d; 
    font-size: 1rem; 
}

/* Error & Empty States */
.error-state, .empty-state { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 4rem 2rem; 
    text-align: center; 
}

.error-state i, .empty-state i { 
    font-size: 4rem; 
    color: #dc3545; 
    margin-bottom: 1rem; 
}

.empty-state i { 
    color: #6c757d; 
}

.error-state h3, .empty-state h3 { 
    font-size: 1.5rem; 
    font-weight: 600; 
    margin-bottom: 0.5rem; 
}

.error-state p, .empty-state p { 
    color: #6c757d; 
    margin-bottom: 1.5rem; 
}

.btn-retry { 
    padding: 12px 24px; 
    background: #10b981;
    color: white; 
    border: none; 
    border-radius: 10px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.3s; 
}

.btn-retry:hover { 
    background: #059669;
    transform: translateY(-2px); 
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Komoditas Grid */
.komoditas-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 1.5rem; 
    margin-bottom: 3rem; 
}

/* Komoditas Card */
.komoditas-card { 
    background: white; 
    border-radius: 16px; 
    overflow: hidden; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
    transition: all 0.3s; 
    cursor: pointer; 
}

.komoditas-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); 
}

.card-image { 
    position: relative; 
    height: 180px; 
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 20px; 
}

.card-image img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}

.card-content { 
    padding: 1.5rem; 
}

.card-title { 
    font-size: 1rem; 
    font-weight: 600; 
    color: #1a1a1a; 
    margin-bottom: 0.75rem; 
    line-height: 1.4; 
}

.card-price { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: #1a1a1a;
    margin-bottom: 1rem; 
}

.card-trend { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 12px; 
    border-radius: 10px; 
}

.card-trend.trend-up { 
    background: #fee2e2;
}

.card-trend.trend-down { 
    background: #d1fae5;
}

.card-trend.trend-stable { 
    background: #dbeafe;
}

.trend-icon { 
    width: 36px; 
    height: 36px; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 18px; 
}

.trend-up .trend-icon { 
    background: #dc3545; 
    color: white; 
}

.trend-down .trend-icon { 
    background: #10b981;
    color: white; 
}

.trend-stable .trend-icon { 
    background: #3b82f6;
    color: white; 
}

.trend-info { 
    flex: 1; 
}

.trend-change { 
    display: block; 
    font-size: 0.9rem; 
    font-weight: 600; 
    color: #1a1a1a; 
}

.trend-percentage { 
    display: block; 
    font-size: 0.85rem; 
    color: #6c757d; 
    margin-top: 2px; 
}

/* Info Section */
.info-section { 
    margin-top: 3rem; 
}

.info-card-full { 
    background: white; 
    border-radius: 16px; 
    padding: 2rem; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
}

.info-card-header { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 1.5rem; 
}

.info-card-header i { 
    font-size: 24px; 
    color: #10b981;
}

.info-card-header h3 { 
    font-size: 1.25rem; 
    font-weight: 600; 
    margin: 0; 
}

.info-card-body ul { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.info-card-body li { 
    padding: 12px 0; 
    border-bottom: 1px solid #f0f0f0; 
    color: #495057; 
    line-height: 1.6; 
}

.info-card-body li:last-child { 
    border-bottom: none; 
}

.info-card-body li:before { 
    content: "✓"; 
    color: #10b981;
    font-weight: bold; 
    margin-right: 12px; 
}

/* Responsive - Tablet */
@media (max-width: 992px) {
    .info-grid { 
        grid-template-columns: 1fr; 
        gap: 1rem; 
    }
    
    .info-card-overlay {
        width: 95%;
        padding: 1.5rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    /* Hero Wrapper - Adjust margin for mobile */
    .hero-wrapper {
        margin-bottom: 0;
    }
    
    /* Hero Section Mobile */
    .hero-image { 
        height: 280px;
        border-radius: 12px;
    }
    
    .hero-title { 
        font-size: 1.75rem; 
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }
    
    .hero-content {
        left: 20px;
        right: 20px;
    }
    
    /* Info Card Overlay Mobile - Fix overflow */
    .info-card-overlay {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        margin-top: 1rem;
        margin-left: 0;
        margin-right: 0;
        padding: 1.25rem;
        border-radius: 12px;
    }
    
    .info-grid { 
        grid-template-columns: 1fr; 
        gap: 1rem; 
    }
    
    .info-item {
        padding: 0.75rem;
        background: #f8f9fa;
        border-radius: 10px;
    }
    
    .info-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
    
    .info-label {
        font-size: 0.75rem;
    }
    
    .info-value {
        font-size: 0.95rem;
    }
    
    /* Section Header Mobile */
    .section-header { 
        flex-direction: column; 
        gap: 1rem;
        margin-top: 2rem;
        align-items: stretch;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-description {
        font-size: 0.9rem;
    }
    
    .section-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-table {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .filter-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
        justify-content: space-between;
    }
    
    .btn-refresh {
        width: 100%;
        height: 48px;
    }
    
    /* Grid Mobile */
    .komoditas-grid { 
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card-image {
        height: 160px;
    }
    
    .card-content {
        padding: 1.25rem;
    }
    
    .card-title {
        font-size: 0.95rem;
    }
    
    .card-price {
        font-size: 1.25rem;
    }
    
    .trend-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .trend-change {
        font-size: 0.85rem;
    }
    
    .trend-percentage {
        font-size: 0.8rem;
    }
    
    /* Info Section Mobile */
    .info-card-full {
        padding: 1.5rem;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 576px) {
    /* Hero Section Small Mobile */
    .hero-image {
        height: 240px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .hero-content {
        left: 15px;
        right: 15px;
    }
    
    /* Info Card Overlay Small Mobile */
    .info-card-overlay {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .info-grid {
        gap: 0.875rem;
    }
    
    .info-item {
        padding: 0.625rem;
    }
    
    .info-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .info-label {
        font-size: 0.7rem;
    }
    
    .info-value {
        font-size: 0.9rem;
    }
    
    /* Section Header Small Mobile */
    .section-title {
        font-size: 1.35rem;
    }
    
    .section-badge {
        font-size: 0.8rem;
        padding: 5px 14px;
    }
    
    /* Card Small Mobile */
    .card-image {
        height: 140px;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-price {
        font-size: 1.15rem;
    }
    
    .card-trend {
        padding: 10px;
        gap: 10px;
    }
    
    /* Info Section Small Mobile */
    .info-card-full {
        padding: 1.25rem;
    }
    
    .info-card-header h3 {
        font-size: 1.1rem;
    }
}

/* Extra Small Mobile (< 400px) */
@media (max-width: 400px) {
    .hero-image {
        height: 220px;
    }
    
    .hero-title {
        font-size: 1.35rem;
    }
    
    .hero-subtitle {
        font-size: 0.8rem;
    }
    
    .info-card-overlay {
        padding: 0.875rem;
    }
    
    .info-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .card-price {
        font-size: 1.1rem;
    }
}

/* Landscape Mode for Mobile - FIXED */
@media (max-width: 768px) and (orientation: landscape) {
    /* Hero adjustments */
    .hero-wrapper {
        margin-bottom: 0.5rem;
    }
    
    .hero-image {
        height: 180px;
    }
    
    .hero-content {
        left: 20px;
        right: auto;
        max-width: 50%;
    }
    
    .hero-title {
        font-size: 1.25rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
    
    /* Info Card - Make it visible and properly positioned */
    .info-card-overlay {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        margin-top: 0.75rem;
        margin-left: 0;
        margin-right: 0;
        padding: 0.875rem;
        border-radius: 10px;
    }
    
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.625rem;
    }
    
    .info-item {
        flex-direction: column;
        text-align: center;
        gap: 0.375rem;
        padding: 0.5rem;
        background: #f8f9fa;
        border-radius: 8px;
    }
    
    .info-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        margin: 0 auto;
    }
    
    .info-label {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .info-value {
        font-size: 0.8rem;
    }
    
    /* Section Header in landscape */
    .section-header {
        margin-top: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .section-description {
        font-size: 0.8rem;
    }
    
    .section-badge {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
    
    /* Section Actions - Keep buttons compact */
    .section-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn-table {
        flex: 1;
        min-width: auto;
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .filter-dropdown {
        flex: 1;
    }
    
    .filter-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .btn-refresh {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    /* Grid in landscape - 2 columns */
    .komoditas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem;
    }
    
    .card-image {
        height: 120px;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .card-price {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .card-trend {
        padding: 8px;
        gap: 8px;
    }
    
    .trend-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .trend-change {
        font-size: 0.75rem;
    }
    
    .trend-percentage {
        font-size: 0.7rem;
    }
    
    /* Info section compact */
    .info-section {
        margin-top: 2rem;
    }
    
    .info-card-full {
        padding: 1.25rem;
    }
    
    .info-card-header h3 {
        font-size: 1rem;
    }
    
    .info-card-body li {
        padding: 8px 0;
        font-size: 0.85rem;
        line-height: 1.4;
    }
}

/* Extra landscape optimization for very short screens */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 450px) {
    .hero-image {
        height: 140px;
    }
    
    .hero-title {
        font-size: 1.1rem;
    }
    
    .hero-subtitle {
        font-size: 0.7rem;
        display: none;
    }
    
    .info-card-overlay {
        padding: 0.625rem;
        margin-top: 0.5rem;
    }
    
    .info-grid {
        gap: 0.5rem;
    }
    
    .info-item {
        padding: 0.375rem;
    }
    
    .info-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .info-label {
        font-size: 0.6rem;
    }
    
    .info-value {
        font-size: 0.75rem;
    }
    
    .section-header {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
}