/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 2rem;
}

.header-content {
    flex: 1;
}

.breadcrumb {
    margin-bottom: 1rem;
}

.breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.breadcrumb a:hover {
    color: #10b981;
}

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

.page-description {
    color: #6c757d;
    font-size: 1rem;
    margin: 0;
}

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

.btn-export {
    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;
}

.btn-export:hover {
    border-color: #10b981;
    color: #10b981;
    background: #f0fdf4;
}

.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); }
}

/* Filter Section */
.filter-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #495057;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: #10b981;
    background: #f0fdf4;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.stat-up {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.stat-icon.stat-down {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon.stat-stable {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-icon.stat-avg {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-content {
    flex: 1;
}

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

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
}

/* 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: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* Table Container */
.table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
}

/* Table Styles */
.harga-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.harga-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.harga-table thead th {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px 12px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #059669;
}

.harga-table thead th.sticky-col {
    position: sticky;
    left: 0;
    z-index: 11;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.harga-table tbody tr {
    transition: all 0.2s;
}

.harga-table tbody tr:hover {
    background: #f8f9fa;
}

.harga-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.harga-table tbody tr:nth-child(even):hover {
    background: #f8f9fa;
}

.harga-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.harga-table tbody td.sticky-col {
    position: sticky;
    left: 0;
    background: white;
    font-weight: 600;
    z-index: 1;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}

.harga-table tbody tr:nth-child(even) td.sticky-col {
    background: #fafafa;
}

.harga-table tbody tr:hover td.sticky-col {
    background: #f8f9fa;
}

.commodity-name {
    min-width: 200px;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.date-column {
    min-width: 120px;
}

/* Price Cell */
.price-cell {
    min-width: 140px;
    font-family: 'Courier New', monospace;
}

.price-value {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.price-trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-icon {
    font-weight: bold;
}

.price-cell.trend-up {
    background: #fee2e2 !important;
}

.price-cell.trend-up .price-trend {
    color: #dc2626;
}

.price-cell.trend-down {
    background: #d1fae5 !important;
}

.price-cell.trend-down .price-trend {
    color: #059669;
}

.price-cell.trend-stable {
    background: #dbeafe !important;
}

.price-cell.trend-stable .price-trend {
    color: #2563eb;
}

.price-cell.no-data {
    color: #adb5bd;
    text-align: center;
}

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

.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;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #495057;
}

.legend-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.2rem;
}

.legend-badge.trend-up {
    background: #fee2e2;
    color: #dc2626;
}

.legend-badge.trend-down {
    background: #d1fae5;
    color: #059669;
}

.legend-badge.trend-stable {
    background: #dbeafe;
    color: #2563eb;
}

.legend-badge.no-data {
    background: #f3f4f6;
    color: #9ca3af;
}

.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 */
@media (max-width: 1024px) {
    .page-header {
        flex-direction: column;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .filter-section {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-wrap: wrap;
    }
    
    .btn-export {
        flex: 1;
        justify-content: center;
    }
    
    .harga-table {
        font-size: 0.85rem;
    }
    
    .harga-table thead th,
    .harga-table tbody td {
        padding: 10px 8px;
    }
    
    .commodity-name {
        min-width: 150px;
    }
    
    .date-column {
        min-width: 100px;
    }
    
    .price-cell {
        min-width: 120px;
    }
    
    .legend-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .info-card-full {
        padding: 1.5rem;
    }
}