/* ================================================
   KONSUMSI IKAN DASHBOARD STYLES - PREMIUM EDITION
   ================================================ */


/* Hero Section with Wave Animation */

.konsumsi-hero {
    min-height: 120px;
}

.wave-bg {
    position: absolute;
    width: 200%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='0.1' d='M0,160L48,138.7C96,117,192,75,288,80C384,85,480,139,576,154.7C672,171,768,149,864,128C960,107,1056,85,1152,90.7C1248,96,1344,128,1392,144L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    animation: waveMove 15s linear infinite;
}

@keyframes waveMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}


/* Filter Glass Effect */

.konsumsi-filter-glass {
    position: relative;
}

.konsumsi-filter-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
    z-index: -1;
}


/* Premium Select Styling */

.konsumsi-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.konsumsi-select:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}


/* Premium Card Effects */

.konsumsi-card-premium {
    position: relative;
    overflow: hidden;
}


/* Chart Card Styling - Larger */

.konsumsi-chart-card {
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 480px;
}

.konsumsi-chart-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.konsumsi-chart-card:hover::after {
    opacity: 1;
}

.konsumsi-chart-card h3 {
    font-size: 1.1rem !important;
}

.konsumsi-chart-card .bg-gradient-to-r {
    padding: 1rem !important;
    flex-shrink: 0;
}


/* Chart/Table Container */

.konsumsi-chart-card>div:nth-child(2) {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


/* Time Series Chart Container - untuk chart */

.konsumsi-chart-card>div:nth-child(2) .relative {
    height: 100% !important;
    flex: 1;
}


/* Top Komoditas Table Scrolling Container */

.konsumsi-chart-card>div:nth-child(2).overflow-x-auto {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 0;
}


/* Table Styling */

.konsumsi-chart-card table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}


/* Table Body */

.konsumsi-chart-card tbody {
    display: table-row-group;
    width: 100%;
}


/* Table Row Height untuk 5 items visible */

.konsumsi-chart-card tbody tr {
    height: 56px;
    border-bottom: 0.5px solid #f0f0f0
}

.konsumsi-chart-card tbody tr td {
    padding: 0.75rem 1rem !important;
    vertical-align: middle;
    word-wrap: break-word;
    overflow-wrap: break-word;
}


/* Sticky Header */

.konsumsi-chart-card thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f9fafb;
}

.konsumsi-chart-card thead tr {
    height: auto;
}

.konsumsi-chart-card thead th {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #f3f3f3;
}


/* Vertical Divider for YoY Column */

.konsumsi-chart-card tbody tr td:nth-child(4),
.konsumsi-chart-card thead tr th:nth-child(4) {
    border-right: 1px solid #e8e8e8 !important;
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}


/* Ensure consistent column widths for alignment */

.konsumsi-chart-card tbody tr td:nth-child(1),
.konsumsi-chart-card thead tr th:nth-child(1) {
    width: 50px !important;
    min-width: 50px !important;
}

.konsumsi-chart-card tbody tr td:nth-child(3),
.konsumsi-chart-card thead tr th:nth-child(3) {
    width: 120px !important;
    min-width: 120px !important;
}

.konsumsi-chart-card tbody tr td:nth-child(5),
.konsumsi-chart-card thead tr th:nth-child(5) {
    width: 120px !important;
    min-width: 120px !important;
}

.konsumsi-chart-card tbody tr td:nth-child(6),
.konsumsi-chart-card thead tr th:nth-child(6) {
    width: 100px !important;
    min-width: 100px !important;
}


/* Custom Scrollbar untuk Top Komoditas */

.konsumsi-chart-card .overflow-x-auto::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.konsumsi-chart-card .overflow-x-auto::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.konsumsi-chart-card .overflow-x-auto::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.3);
    border-radius: 10px;
}

.konsumsi-chart-card .overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.6);
}


/* Loading Animation - Enhanced */

.konsumsi-card-premium:nth-child(2) .fa-chart-pie {
    animation-delay: 0.5s;
}

.konsumsi-card-premium:nth-child(3) .fa-coins {
    animation-delay: 1s;
}

.konsumsi-card-premium:nth-child(4) .fa-dna {
    animation-delay: 1.5s;
}


/* Gradient Text Effect */

.gradient-text {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* Shimmer Effect for Loading States */

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}


/* Scorecard Size Reduction - More Compact */

.konsumsi-card-premium {
    padding: 0.6rem 0.8rem !important;
}

.konsumsi-card-premium p.text-3xl,
.konsumsi-card-premium p.text-4xl {
    font-size: 1.25rem !important;
    line-height: 1.2;
}

.konsumsi-card-premium .w-12 {
    width: 1.75rem !important;
    height: 1.75rem !important;
}

.konsumsi-card-premium .w-12 i {
    font-size: 0.875rem !important;
}

.konsumsi-card-premium .text-xs {
    font-size: 0.65rem;
}

.konsumsi-card-premium .text-white\/80 {
    font-size: 0.65rem;
}

.konsumsi-card-premium .flex.items-start.justify-between {
    gap: 0.3rem;
}

.konsumsi-card-premium .text-white\/60 {
    font-size: 0.6rem !important;
}


/* Responsive Adjustments */

@media (max-width: 768px) {
    .konsumsi-hero {
        min-height: 150px;
    }
    .konsumsi-hero h2 {
        font-size: 1.5rem;
    }
    .konsumsi-card-premium {
        padding: 0.75rem 0.5rem !important;
    }
    .konsumsi-card-premium .text-3xl,
    .konsumsi-card-premium .text-4xl {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 480px) {
    .konsumsi-hero {
        min-height: 120px;
    }
    .konsumsi-hero .w-16 {
        width: 3rem;
        height: 3rem;
    }
    .konsumsi-hero .text-3xl {
        font-size: 1.25rem;
    }
    .konsumsi-filter-glass .grid {
        grid-template-columns: 1fr;
    }
}


/* Glow Effects */

.glow-cyan {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.glow-green {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.glow-purple {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.glow-orange {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}


/* Card Number Counter Animation */

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.konsumsi-card-premium p[id^="card"] {
    animation: countUp 0.5s ease-out;
}


/* Scroll Reveal Animation */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.konsumsi-card-premium,
.konsumsi-chart-card {
    animation: fadeInUp 0.6s ease-out;
}

.konsumsi-card-premium:nth-child(1) {
    animation-delay: 0.1s;
}

.konsumsi-card-premium:nth-child(2) {
    animation-delay: 0.2s;
}

.konsumsi-card-premium:nth-child(3) {
    animation-delay: 0.3s;
}

.konsumsi-card-premium:nth-child(4) {
    animation-delay: 0.4s;
}


/* ================================================
   YOY STYLING - BADGE DESIGN (MATCHES TOP KOMODITAS)
   ================================================ */

[id$="YoY"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
}
