/* 
 * KeraList - Modern Mobile-First Design
 * Inspired by modern fintech/expense tracker apps
 * Supports both light and dark themes
 */

:root {
    /* Light Theme (Default) */
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f3f8;

    --text-primary: #1a1b2e;
    --text-secondary: #8b8d97;
    --text-muted: #b8bac6;

    --accent-primary: #4f46e5;
    /* Indigo for better contrast in Light mode */
    --accent-secondary: #a29bfe;
    --accent-coral: #ff7675;
    --accent-teal: #00cec9;
    --accent-orange: #fdcb6e;
    --accent-green: #00b894;
    --accent-blue: #0984e3;

    --gradient-main: linear-gradient(135deg, #ff7675 0%, #4f46e5 50%, #0984e3 100%);
    --gradient-purple: linear-gradient(135deg, #4f46e5 0%, #a29bfe 100%);
    --gradient-coral: linear-gradient(135deg, #ff7675 0%, #fd79a8 100%);
    --gradient-teal: linear-gradient(135deg, #00cec9 0%, #81ecec 100%);
    --gradient-orange: linear-gradient(135deg, #fdcb6e 0%, #f39c12 100%);

    --border-color: #e8eaf0;
    --shadow-sm: 0 2px 8px rgba(26, 27, 46, 0.06);
    --shadow-md: 0 4px 16px rgba(26, 27, 46, 0.08);
    --shadow-lg: 0 8px 32px rgba(26, 27, 46, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

[data-theme="dark"] {
    --bg-primary: #1a1b2e;
    --bg-secondary: #252741;
    --bg-card: #252741;
    --bg-card-hover: #2d2f4a;

    --text-primary: #ffffff;
    --text-secondary: #8b8d97;
    --text-muted: #5a5c6f;

    --accent-primary: #a5b4fc;
    /* Light Indigo for better contrast in Dark mode */

    --border-color: #3a3c52;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    transform: scale(1.05);
}

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

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 32px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.last-updated {
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    font-weight: 500;
    font-size: 13px;
}

/* Price Ticker */
.price-ticker {
    text-align: center;
    padding: 16px 20px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.ticker-emoji {
    font-size: 18px;
    margin-right: 8px;
}

.ticker-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.ticker-content {
    display: inline-flex;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.ticker-content.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.ticker-content.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.full-width {
    grid-column: 1 / -1;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: calc(var(--radius-xl) + 2px);
    background: conic-gradient(from var(--glow-angle, 0deg),
            transparent 0deg,
            var(--card-glow-color, var(--primary-color)) 45deg,
            var(--card-glow-color, var(--primary-color)) 90deg,
            transparent 135deg);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    z-index: -1;
}

.card:hover::before {
    opacity: 1;
    animation: glow-rotate 2s linear infinite;
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg), 0 0 25px var(--card-glow-color, rgba(108, 92, 231, 0.3));
}

@keyframes glow-rotate {
    0% {
        --glow-angle: 0deg;
    }

    100% {
        --glow-angle: 360deg;
    }
}

@property --glow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Card-specific glow colors */
.card-fuel {
    --card-glow-color: #e17055;
}

.card-gold {
    --card-glow-color: #fdcb6e;
}

.card-silver {
    --card-glow-color: #b2bec3;
}

.card-lpg {
    --card-glow-color: #ff7675;
}

.card-milk {
    --card-glow-color: #74b9ff;
}

.card-coconut {
    --card-glow-color: #55a3ff;
}

.card-egg {
    --card-glow-color: #ffeaa7;
}

.card-chicken {
    --card-glow-color: #fab1a0;
}

.card-vegetables {
    --card-glow-color: #00b894;
}

.card-fruits {
    --card-glow-color: #fdcb6e;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Icon Colors - Matching the app design */
.icon-fuel {
    background: var(--gradient-coral);
}

.icon-gold {
    background: linear-gradient(135deg, #fdcb6e 0%, #f39c12 100%);
}

.icon-silver {
    background: linear-gradient(135deg, #b2bec3 0%, #dfe6e9 100%);
    color: #636e72;
}

.icon-lpg {
    background: var(--gradient-purple);
}

.icon-vegetables {
    background: var(--gradient-teal);
}

.icon-fruits {
    background: var(--gradient-orange);
}

.icon-eggs {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #d68910;
}

.icon-chicken {
    background: linear-gradient(135deg, #fab1a0 0%, #e17055 100%);
}

.icon-fish {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.icon-dairy {
    background: linear-gradient(135deg, #dfe6e9 0%, #b2bec3 100%);
    color: #636e72;
}

.icon-coconut {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
}

.icon-spices {
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 184, 148, 0.1);
    color: var(--accent-green);
    position: relative;
    padding-left: 22px;
}

.badge-success::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 0.4;
        transform: translateY(-50%) scale(0.8);
    }
}

.badge-warning {
    background: rgba(253, 203, 110, 0.1);
    color: #e17055;
}

.badge-info {
    background: rgba(108, 92, 231, 0.1);
    color: var(--accent-primary);
}

.badge-danger {
    background: rgba(255, 118, 117, 0.1);
    color: var(--accent-coral);
}

/* Price Display */
.price-display {
    text-align: center;
    padding: 16px 0;
}

.main-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -1px;
}

.price-unit {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.price-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 12px;
    margin-top: 8px;
}

.price-up {
    background: rgba(0, 184, 148, 0.1);
    color: var(--accent-green);
}

.price-down {
    background: rgba(255, 118, 117, 0.1);
    color: var(--accent-coral);
}

.price-stable {
    background: rgba(139, 141, 151, 0.1);
    color: var(--text-secondary);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 8px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.data-table th:first-child,
.data-table td:first-child {
    text-align: left;
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table td strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Responsive Table container */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    /* Negative margin to span full width */
    padding: 0 20px;

    /* Custom Thin Scrollbar for Desktop usability */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* District List - replaces table for better mobile display */
.district-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 4px;
}

.district-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.district-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.district-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.fuel-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fuel-price strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.fuel-price.petrol strong,
.fuel-price.domestic strong {
    color: var(--primary-color);
}

.table-wrapper::-webkit-scrollbar {
    height: 6px;
    display: block;
}

.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

@media (max-width: 480px) {

    .data-table th,
    .data-table td {
        padding: 10px 4px;
        font-size: 12px;
    }

    .data-table th:first-child,
    .data-table td:first-child {
        padding-left: 0;
    }

    .data-table th:last-child,
    .data-table td:last-child {
        padding-right: 0;
    }
}

/* Item Grid */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.item-card {
    background: var(--bg-card-hover);
    padding: 14px 12px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.item-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-primary);
}

.item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
    text-align: center;
}

.item-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Fruit Items - Unique styling */
.fruit-item {
    background: rgba(253, 203, 110, 0.08);
    border-color: rgba(253, 203, 110, 0.2);
}

.fruit-item:hover {
    background: rgba(253, 203, 110, 0.15);
}

.fruit-item .item-price {
    color: #e17055;
}

/* Collapsible */
.collapsible-header {
    background: var(--bg-card-hover);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    margin-top: 16px;
    color: var(--accent-primary);
    border: 1px solid var(--border-color);
}

.collapsible-header:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.expanded {
    max-height: 2000px;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: var(--accent-primary);
}

.expand-icon.rotated {
    transform: rotate(180deg);
}

/* Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    /* 6 columns for 11 items */
    gap: 12px;
    margin-top: 20px;
}

@media (max-width: 1200px) {
    .summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.summary-item {
    text-align: center;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.summary-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: var(--text-secondary);
    background: var(--bg-card);
}

.summary-item .emoji {
    font-size: 24px;
    margin-bottom: 8px;
}

.summary-item .label {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.summary-item .value {
    color: var(--text-secondary);
    font-size: 12px;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-purple);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    animation: slideUp 0.3s ease;
}

.toast.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 32px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-disclaimer {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    width: 100%;
    margin: 0 0 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.footer-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* PDF Viewer */
.pdf-viewer-wrapper {
    width: 100%;
}

.pdf-viewer-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.pdf-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.pdf-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 50;
}

.pdf-toolbar .toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-btn {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pdf-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.pdf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-secondary);
    font-size: 14px;
    min-width: 100px;
    text-align: center;
}

.zoom-select {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}

.pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    gap: 16px;
}

.pdf-container {
    overflow: auto;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.pdf-page {
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border-radius: 4px;
}

.pdf-page canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Fullscreen PDF - Only the PDF pages fill the screen */
.pdf-container:fullscreen,
.pdf-container:-webkit-full-screen {
    background: #000;
    padding: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: auto;
}

.pdf-container:fullscreen .pdf-page,
.pdf-container:-webkit-full-screen .pdf-page {
    margin: 10px auto;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.pdf-container:fullscreen canvas,
.pdf-container:-webkit-full-screen canvas {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}

/* Mobile expanded view (iOS Safari fallback for fullscreen) */
.pdf-container.pdf-expanded {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: none;
    z-index: 9999;
    background: #000;
    border-radius: 0;
    border: none;
    margin: 0;
}

.pdf-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .pdf-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .pdf-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .pdf-title {
        font-size: 18px;
    }

    .pdf-container {
        padding: 10px;
    }
}

/* Static Pages */
.static-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.static-page-header {
    margin-bottom: 32px;
}

.static-page-header .back-link {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.2s ease;
}

.static-page-header .back-link:hover {
    color: var(--primary-color);
}

.static-page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.static-page-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
}

/* Festivals Grid */
.festivals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.festival-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.festival-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.festival-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.festival-info {
    flex: 1;
}

.festival-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.festival-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.festival-year {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-primary);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.page-subtitle {
    color: var(--text-secondary);
    margin: 8px 0 0 0;
}

.static-page-content section {
    margin-bottom: 24px;
}

.static-page-content section:last-child {
    margin-bottom: 0;
}

.static-page-content h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.static-page-content p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.static-page-content .last-updated {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-style: italic;
}

.contact-email {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

.contact-email:hover {
    text-decoration: underline;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
}

.no-data-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-card-hover) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .welcome-title {
        font-size: 22px;
    }

    .main-price {
        font-size: 28px;
    }

    .dashboard-grid {
        gap: 16px;
    }

    .card {
        padding: 16px;
    }

    .item-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .header-content {
        padding: 0 16px;
    }

    .container {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .welcome-title {
        font-size: 20px;
    }

    .card {
        padding: 14px;
        border-radius: var(--radius-lg);
    }

    .main-price {
        font-size: 24px;
    }

    .item-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .item-card {
        padding: 10px 8px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Gradient Text */
.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===========================================
   Detail Page Styles
   =========================================== */

/* Summary Link Styles */
.summary-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.summary-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.summary-link:hover .label {
    color: white;
}

/* Detail Page Layout */
.detail-page {
    padding: 20px 0;
}

.detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
}

.detail-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Navigation */
.detail-nav {
    margin-bottom: 24px;
}

.back-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Hero Section */
.detail-hero {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.hero-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.hero-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.hero-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.current-price {
    font-size: 48px;
    font-weight: 800;
    color: var(--accent-primary);
}

.price-date {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Hero Stats for Fuel Pages */
.hero-stats {
    display: flex;
    gap: 24px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card-hover);
    min-width: 180px;
}

.stat-item.stat-low {
    border-left: 4px solid var(--accent-green);
}

.stat-item.stat-high {
    border-left: 4px solid var(--accent-coral);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Price Unit Label in Hero */
.price-unit-label {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 4px;
}

/* Gold Variants Grid */
.gold-variants-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .gold-variants-grid {
        grid-template-columns: 1fr;
    }
}

.gold-variant-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.gold-variant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.gold-variant-card.gold-highlight {
    border: 2px solid #FFD700;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 215, 0, 0.05) 100%);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.15);
}

.variant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-label {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.popular-badge {
    font-size: 11px;
    font-weight: 700;
    color: #B8860B;
    background: rgba(255, 215, 0, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
}

.variant-prices {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.variant-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.variant-price-row:last-child {
    border-bottom: none;
}

.price-type {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.price-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Silver Variants Grid */
.silver-variants-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .silver-variants-grid {
        grid-template-columns: 1fr;
    }
}

.silver-variant-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.3s ease;
}

.silver-variant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.silver-variant-card.silver-highlight {
    border: 2px solid #C0C0C0;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(192, 192, 192, 0.08) 100%);
    box-shadow: 0 4px 20px rgba(192, 192, 192, 0.2);
}

.silver-price-display {
    margin-top: 12px;
}

.silver-price-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Multi-Item Grid Section */
.items-grid-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.items-grid-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.multi-item-card {
    background: var(--bg-card-hover);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.multi-item-card:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.multi-item-card.highlight-item {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-card-hover) 0%, rgba(16, 185, 129, 0.05) 100%);
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.15);
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-emoji {
    font-size: 18px;
}

.item-sub {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}


.item-unit {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 2px;
}

/* Detail Content Grid */
.detail-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 1024px) {
    .detail-content {
        grid-template-columns: 2fr 1fr;
    }
}

/* Chart Container */
.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-period-selector {
    display: flex;
    gap: 8px;
}

.period-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card-hover);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.period-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

/* Prediction Card */
.prediction-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.prediction-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.prediction-icon {
    font-size: 32px;
}

.prediction-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.prediction-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prediction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.prediction-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.prediction-value {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.change-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: currentColor;
    color: white;
}

.prediction-value.price-up .change-badge {
    background: var(--accent-green);
}

.prediction-value.price-down .change-badge {
    background: var(--accent-coral);
}

.confidence-bar {
    flex: 1;
    min-width: 120px;
    height: 8px;
    background: var(--bg-card-hover);
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-teal));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.confidence-bar span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.prediction-suggestion {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-card-hover);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
}

.suggestion-icon {
    font-size: 18px;
}

/* Info Card (for market overview, no prediction) */
.info-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.info-card h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-card p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Price Range in Hero */
.current-price.price-range {
    font-size: 28px;
}

/* Price Details Card */
.price-details-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    grid-column: 1 / -1;
}

.price-details-card h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Responsive Detail Page */
@media (max-width: 768px) {
    .detail-hero {
        padding: 24px;
    }

    .hero-icon {
        font-size: 48px;
    }

    .hero-title {
        font-size: 24px;
    }

    .current-price {
        font-size: 36px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-wrapper {
        height: 250px;
    }
}