/* Modern Gold Price Thailand - Custom CSS */

/* Font Face Declaration */
@font-face {
    font-family: 'SukhumvitSet';
    src: url('../fonts/SukhumvitSet.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Premium Gold Palette - Luxurious tones */
    --gold-primary: #D4AF37;      /* Classic luxury gold */
    --gold-secondary: #F4E4C1;    /* Champagne gold */
    --gold-dark: #85652D;         /* Deep bronze gold */
    --gold-light: #FFF9ED;        /* Cream gold */
    --gold-accent: #C5A572;       /* Rose gold */
    --gold-metallic: linear-gradient(135deg, #D4AF37 0%, #F9E4B7 50%, #D4AF37 100%);
    
    /* Sophisticated neutrals */
    --white: #FFFFFF;
    --off-white: #FAFAF8;
    --light-gray: #F7F7F5;
    --medium-gray: #C4C4C4;
    --dark-gray: #5A5A5A;
    --charcoal: #2D2D2D;
    --black: #1A1A1A;
    
    /* Refined status colors */
    --price-up: #059669;          /* Emerald green */
    --price-down: #DC2626;        /* Ruby red */
    --price-neutral: #9CA3AF;
    
    /* Layered shadows with gold tint */
    --shadow-xs: 0 1px 2px rgba(212, 175, 55, 0.05);
    --shadow-sm: 0 2px 4px rgba(212, 175, 55, 0.08), 
                 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 8px rgba(212, 175, 55, 0.1), 
                 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 16px rgba(212, 175, 55, 0.12), 
                 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 12px 24px rgba(212, 175, 55, 0.15), 
                 0 6px 12px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.3);
    
    /* Smooth transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base styles - ใช้ system font ธรรมดาทั้งระบบ */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans Thai', 'Noto Sans', sans-serif;
    background: linear-gradient(to bottom, var(--off-white) 0%, var(--light-gray) 100%);
    background-attachment: fixed;
    color: var(--charcoal);
    line-height: 1.75;
    font-weight: 400;
    letter-spacing: 0.01em;
    font-size: 15px;
}

/* Headlines - ส่วนสำคัญ คงฟอนต์ SukhumvitSet/Prompt เพื่อความเด่นชัด */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'SukhumvitSet', 'Prompt', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--charcoal);
}

/* โลโก้แบรนด์ Moohin - ส่วนสำคัญ คงฟอนต์เดิมเพื่อเอกลักษณ์ */
.navbar-brand {
    font-family: 'SukhumvitSet', 'Prompt', sans-serif;
}

h1, .h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2, .h2 {
    font-size: 1.875rem;
    font-weight: 600;
}

h3, .h3 {
    font-size: 1.5rem;
}

h4, .h4 {
    font-size: 1.25rem;
}

h5, .h5 {
    font-size: 1.125rem;
}

/* Header and Navigation - Premium Style */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    position: relative;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--transition-normal);
    letter-spacing: -0.01em;
}

.navbar-brand:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.nav-link {
    font-weight: 500;
    color: var(--dark-gray) !important;
    padding: 0.625rem 1.125rem !important;
    border-radius: 8px;
    transition: all var(--transition-normal);
    margin: 0 0.25rem;
    position: relative;
    letter-spacing: 0.01em;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gold-metallic);
    transition: width var(--transition-normal);
}

.nav-link:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.15));
    color: var(--gold-dark) !important;
    transform: translateY(-1px);
}

.nav-link:hover::before {
    width: 60%;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--gold-light), var(--gold-secondary));
    color: var(--gold-dark) !important;
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

/* Status bar */
.status-bar {
    background-color: var(--gold-light);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.status-bar .badge {
    font-weight: 400;
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
}

/* Cards - Luxury Design */
.card {
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom, var(--white) 0%, rgba(255, 249, 237, 0.3) 100%);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-metallic);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.3);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-secondary) 100%);
    color: var(--gold-dark);
    font-weight: 600;
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    letter-spacing: 0.01em;
}

.card-header i {
    color: var(--gold-primary);
    margin-right: 0.625rem;
    filter: drop-shadow(0 1px 2px rgba(212, 175, 55, 0.3));
}

.card-body {
    padding: 1.75rem;
    background-color: var(--white);
}

/* Gold price cards - Premium Frame */
.gold-price-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--white) 0%, rgba(255, 249, 237, 0.5) 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.gold-price-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 2px;
    background: var(--gold-metallic);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.gold-price-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* Price displays */
.price-display {
    padding: 1.25rem;
    border-radius: 6px;
    transition: all var(--transition-normal);
}

.price-label {
    font-size: 0.95rem;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.price-value {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.price-value.buy {
    color: var(--price-up);
}

.price-value.sell {
    color: var(--price-down);
}

.price-date {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    background-color: var(--gold-light);
    color: var(--gold-dark);
    box-shadow: var(--shadow-sm);
}

/* Tables */
.table-gold {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-gold th {
    background-color: var(--gold-light);
    color: var(--gold-dark);
    padding: 0.875rem;
    font-weight: 500;
    border: none;
}

.table-gold td {
    padding: 0.875rem;
    vertical-align: middle;
    border-color: var(--light-gray);
}

.table-gold tr:nth-child(even) {
    background-color: var(--off-white);
}

.table-gold tr:hover {
    background-color: var(--light-gray);
}

/* Buttons - Premium Style with Gradients */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-accent) 100%);
    border: none;
    color: var(--white);
    font-weight: 500;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.btn-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-primary) 100%);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-gold:hover::before {
    left: 100%;
}

.btn-gold:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-outline-gold {
    background-color: transparent;
    border: 2px solid var(--gold-primary);
    color: var(--gold-dark);
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-outline-gold::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--gold-light);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-outline-gold:hover {
    color: var(--gold-dark);
    border-color: var(--gold-dark);
    transform: translateY(-1px);
}

.btn-outline-gold:hover::before {
    width: 300px;
    height: 300px;
}

.btn-outline-gold span {
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    background-color: var(--black);
    color: var(--medium-gray);
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--dark-gray);
}

.footer h5 {
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer a {
    color: var(--white);
    transition: color var(--transition-fast);
    text-decoration: none;
}

.footer a:hover {
    color: var(--gold-secondary);
    text-decoration: none;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

/* Charts */
canvas {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    background-color: #ffffff;
    min-height: 300px;
    width: 100% !important;
    height: auto !important;
}

/* Chart container */
#monthlyGoldPriceChart {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px;
    max-height: 400px;
    height: 400px;
}

/* Ensure chart is visible */
.card-body canvas {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* Mobile-specific chart improvements */
@media (max-width: 768px) {
    #monthlyGoldPriceChart {
        padding: 5px;
        min-height: 250px;
        height: 250px !important;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-header h5 {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    .btn-outline-gold {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Table improvements for mobile */
    .table-gold {
        font-size: 0.75rem;
    }
    
    .table-gold th,
    .table-gold td {
        padding: 0.4rem 0.2rem;
        white-space: nowrap;
        text-align: center;
    }
    
    .table-gold th {
        font-size: 0.7rem;
        font-weight: 600;
        line-height: 1.2;
    }
    
    /* Hide less important columns on very small screens */
    @media (max-width: 576px) {
        .table-gold th:nth-child(6),
        .table-gold td:nth-child(6),
        .table-gold th:nth-child(7),
        .table-gold td:nth-child(7) {
            display: none;
        }
        
        .table-gold th,
        .table-gold td {
            padding: 0.3rem 0.15rem;
            font-size: 0.7rem;
        }
        
        #monthlyGoldPriceChart {
            min-height: 200px;
            height: 200px !important;
        }
    }
}

/* Optimizations for 375px screens (iPhone SE, iPhone 12 mini, etc.) */
@media (max-width: 375px) {
    /* Container adjustments */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Typography adjustments */
    h1, .h1 {
        font-size: 1.75rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    h3, .h3 {
        font-size: 1.25rem;
    }
    
    /* Navbar adjustments */
    .navbar {
        padding: 0.875rem 0.5rem;
    }
    
    .navbar-brand {
        font-size: 1.15rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.875rem !important;
        font-size: 0.9rem;
    }
    
    /* Card adjustments */
    .card {
        margin-bottom: 0.875rem;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .card-header h5 {
        font-size: 0.875rem;
        margin: 0;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Price display adjustments */
    .price-display {
        padding: 0.875rem;
    }
    
    .price-label {
        font-size: 0.8rem;
        margin-bottom: 0.375rem;
    }
    
    .price-value {
        font-size: 1.375rem;
        margin-bottom: 0.375rem;
    }
    
    .price-date {
        padding: 0.3rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Table adjustments */
    .table-gold {
        font-size: 0.65rem;
    }
    
    .table-gold th,
    .table-gold td {
        padding: 0.25rem 0.1rem;
        font-size: 0.65rem;
    }
    
    .table-gold th {
        font-size: 0.6rem;
        line-height: 1.1;
    }
    
    /* Chart adjustments */
    #monthlyGoldPriceChart {
        min-height: 180px;
        height: 180px !important;
        padding: 3px;
    }
    
    canvas {
        min-height: 180px;
    }
    
    /* Button adjustments */
    .btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .btn-gold {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .btn-outline-gold {
        padding: 0.3rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .btn-historical {
        padding: 0.625rem 1.125rem;
        font-size: 0.875rem;
    }
    
    .btn-share-header {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
    
    /* Badge adjustments */
    .badge {
        padding: 0.25rem 0.625rem;
        font-size: 0.7rem;
    }
    
    /* Footer adjustments */
    .footer {
        padding: 1.75rem 0 1rem;
        font-size: 0.85rem;
    }
    
    .footer h5 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Hero section adjustments */
    .hero-section {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    /* Info section adjustments */
    .info-section {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .info-section h5 {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    /* Pagination adjustments */
    .mobile-pagination {
        margin: 1rem 0;
        padding: 0.625rem;
    }
    
    .mobile-pagination .pagination-wrapper {
        gap: 0.375rem;
        min-height: 44px;
    }
    
    .mobile-pagination .page-info .badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.875rem;
        min-width: 90px;
    }
    
    .mobile-pagination .page-info .small {
        font-size: 0.7rem;
    }
    
    .mobile-pagination .btn {
        padding: 0.4rem 0.625rem;
        min-width: 70px;
        font-size: 0.8rem;
    }
    
    /* Back to top button adjustments */
    .back-to-top-btn {
        width: 36px;
        height: 36px;
        bottom: 15px;
        right: 15px;
    }
    
    .back-to-top-btn i {
        font-size: 0.95rem;
    }
    
    /* Share modal adjustments */
    .share-modal {
        width: 95%;
        margin: 0.5rem;
    }
    
    .share-modal-header {
        padding: 1rem;
    }
    
    .share-modal-header h5 {
        font-size: 1rem;
    }
    
    .share-modal-body {
        padding: 1rem;
    }
    
    .share-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .share-option {
        padding: 0.625rem 0.375rem;
    }
    
    .share-option i {
        font-size: 1.125rem;
    }
    
    .share-option span {
        font-size: 0.75rem;
    }
    
    /* Gold price banner adjustments */
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Quick link card adjustments */
    .quick-link-card i {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    /* Toast notification adjustments */
    .toast-notification {
        max-width: 280px;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        top: 10px;
        right: 10px;
    }
    
    /* Today's Gold Prices table adjustments */
    .card-body.p-0 .table-responsive {
        padding: 0.5rem;
    }
    
    .card-body.p-0 .table-gold {
        font-size: 0.7rem;
    }
    
    .card-body.p-0 .table-gold th,
    .card-body.p-0 .table-gold td {
        padding: 0.4rem 0.2rem;
    }
    
    /* Header with logo and share button */
    .card-body.p-0 .table-gold thead th:first-child .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .card-body.p-0 .table-gold thead img {
        width: 28px !important;
        height: 28px !important;
        margin-right: 8px !important;
    }
    
    .card-body.p-0 .table-gold thead span {
        font-size: 0.8rem !important;
    }
    
    /* Badge adjustments in table */
    .card-body.p-0 .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Share button in table header */
    .card-body.p-0 .btn-share-header {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    /* Gold type images in table */
    .card-body.p-0 .table-gold tbody img {
        width: 14px !important;
        height: auto !important;
        margin-right: 4px !important;
    }
    
    /* Price values in table */
    .card-body.p-0 .table-gold tbody span[style*="font-size: 1.05rem"] {
        font-size: 0.85rem !important;
    }
    
    /* Footer text in table */
    .card-body.p-0 .table-gold tfoot td {
        font-size: 0.65rem !important;
        padding: 0.5rem 0.3rem !important;
    }
    
    .card-body.p-0 .table-gold tfoot .badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
        margin: 0.1rem;
    }
    
    /* Icon adjustments */
    .card-body.p-0 .table-gold i {
        font-size: 0.7rem;
    }
    
    /* Market Updates Section adjustments */
    /* Card header adjustments */
    .card-header .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start !important;
    }
    
    .card-header h5 {
        font-size: 0.9rem;
    }
    
    .card-header .d-flex.align-items-center {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Market status badge */
    .card-header .badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }
    
    .card-header .badge .rounded-circle {
        width: 6px !important;
        height: 6px !important;
    }
    
    /* View all button in header */
    .card-header .btn-sm {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* Market Open/Close sections */
    .row.g-0 > .col-lg-6 {
        border-right: none !important;
        border-bottom: 1px solid rgba(218, 165, 32, 0.1);
    }
    
    .row.g-0 > .col-lg-6:last-child {
        border-bottom: none;
    }
    
    .row.g-0 > .col-lg-6 > div {
        padding: 1rem !important;
    }
    
    /* Icon circle adjustments */
    .row.g-0 .d-flex.align-items-center .me-3 {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }
    
    /* Title adjustments */
    .row.g-0 h6.fw-bold {
        font-size: 0.85rem;
    }
    
    .row.g-0 small.text-muted {
        font-size: 0.7rem;
    }
    
    /* Content adjustments */
    .row.g-0 h6.fw-semibold {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .row.g-0 p.text-muted {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    /* Time and button adjustments */
    .row.g-0 .d-flex.justify-content-between small {
        font-size: 0.7rem;
    }
    
    .row.g-0 .btn-sm {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* Empty state adjustments */
    .row.g-0 .text-center.py-4 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .row.g-0 .fa-2x {
        font-size: 1.5rem !important;
    }
    
    .row.g-0 .text-center p {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .row.g-0 .text-center small {
        font-size: 0.7rem;
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    .btn {
        min-height: 44px; /* iOS recommended touch target size */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .card-header .btn {
        min-height: 36px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    #monthlyGoldPriceChart {
        min-height: 180px;
        height: 180px !important;
    }
}

/* Badges */
.badge {
    font-weight: 400;
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
}

.badge-gold {
    background-color: var(--gold-primary);
    color: var(--white);
}

.badge-light-gold {
    background-color: var(--gold-light);
    color: var(--gold-dark);
    border: 1px solid var(--gold-primary);
}

/* Update count badge */
.badge-update-count {
    border: 1px solid var(--gold-primary);
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    color: var(--gold-dark);
    background-color: var(--gold-light);
}

/* Historical Gold Price Button */
.btn-historical {
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background-color: var(--gold-primary);
    border: 1px solid var(--gold-dark);
    color: var(--white);
    font-weight: 500;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
}

.btn-historical:hover {
    background-color: var(--gold-dark);
    color: var(--white) !important;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .price-value {
        font-size: 1.5rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1.2rem;
    }
    
    .table-gold th, 
    .table-gold td {
        padding: 0.75rem;
    }
}

/* Gold icon styling */
.gold-icon {
    color: var(--gold-primary);
}

/* Section titles */
.section-title {
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Hero section */
.hero-section {
    background-color: var(--gold-light);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.hero-section h1 {
    color: var(--gold-dark);
    font-weight: 600;
}

/* Quick links */
.quick-link-card {
    height: 100%;
    transition: box-shadow var(--transition-normal);
}

.quick-link-card:hover {
    box-shadow: var(--shadow-md);
}

.quick-link-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.quick-link-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--gold-primary);
}

/* Info sections */
.info-section {
    background-color: rgba(255, 215, 0, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.info-section h5 {
    color: var(--gold-dark);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Price change indicators */
.price-up {
    color: var(--price-up);
    font-weight: 500;
}

.price-down {
    color: var(--price-down);
    font-weight: 500;
}

.price-unchanged {
    color: var(--dark-gray);
}

/* Price direction badges */
.badge.bg-success {
    background-color: var(--price-up) !important;
}

.badge.bg-danger {
    background-color: var(--price-down) !important;
}

.badge.bg-secondary {
    background-color: var(--dark-gray) !important;
}

/* Price change values */
.text-success {
    color: var(--price-up) !important;
    font-weight: 500;
}

.text-danger {
    color: var(--price-down) !important;
    font-weight: 500;
}

.text-secondary {
    color: var(--price-neutral) !important;
}

/* Table adjustments for price updates */
.table-gold th, 
.table-gold td {
    text-align: center;
    vertical-align: middle;
}

/* Remove background color from specific header cells in goldPriceUpdatesCollapse */
#goldPriceUpdatesCollapse thead>tr:first-child>th:first-child,
#goldPriceUpdatesCollapse thead>tr:first-child>th:nth-last-child(2),
#goldPriceUpdatesCollapse thead>tr:first-child>th:last-child {
    background-color: transparent !important;
}

/* Make the price change table more compact on mobile */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* Pagination styling for Tailwind CSS */
nav[aria-label="Pagination Navigation"] {
    margin: 2rem 0;
}

/* Gold Price Share Button */
.btn-gold-share {
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background-color: #44A08D;
    border: 1px solid #2E8B7A;
    color: white;
    font-weight: 500;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
}

.btn-gold-share:hover {
    background-color: #2E8B7A;
    color: white !important;
}

.btn-gold-share:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Share Modal */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.share-modal {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
}

.share-modal-overlay.show .share-modal {
    transform: scale(1) translateY(0);
}

.share-modal-header {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-modal-header h5 {
    margin: 0;
    font-weight: 600;
}

.close-share-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-share-modal:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.share-modal-body {
    padding: 1.5rem;
}

.share-preview {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.share-preview canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.share-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
}

.share-option:hover {
    border-color: var(--gold-primary);
    background: var(--gold-light);
    color: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.share-option i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.share-option[data-action="download"] i {
    color: #28a745;
}

.share-option[data-action="copy"] i {
    color: #6f42c1;
}

.share-option[data-action="share"] i {
    color: #007bff;
}

.share-option[data-action="facebook"] i {
    color: #1877f2;
}

.share-option[data-action="line"] i {
    color: #00c300;
}

.share-option span {
    font-size: 0.85rem;
    text-align: center;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    font-weight: 500;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 350px;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-notification.toast-success {
    border-left: 4px solid #28a745;
    color: #155724;
}

.toast-notification.toast-success i {
    color: #28a745;
}

.toast-notification.toast-error {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.toast-notification.toast-error i {
    color: #dc3545;
}

/* Responsive adjustments for share modal */
@media (max-width: 768px) {
    .share-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .share-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .share-option {
        padding: 0.75rem 0.5rem;
    }
    
    .share-option i {
        font-size: 1.25rem;
    }
    
    .share-option span {
        font-size: 0.8rem;
    }
}

/* Mobile pagination (sm:hidden) */
.flex.justify-between.flex-1.sm\:hidden a,
.flex.justify-between.flex-1.sm\:hidden span {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all var(--transition-normal);
    text-decoration: none;
    margin: 0 0.25rem;
}

.flex.justify-between.flex-1.sm\:hidden a {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--white) !important;
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-sm);
}

.flex.justify-between.flex-1.sm\:hidden a:hover {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.flex.justify-between.flex-1.sm\:hidden span {
    background-color: var(--light-gray);
    color: var(--medium-gray) !important;
    border: 1px solid rgba(212, 175, 55, 0.1);
    cursor: not-allowed;
}

/* Desktop pagination (hidden sm:flex) */
.hidden.sm\:flex-1.sm\:flex.sm\:items-center.sm\:justify-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Pagination info text */
.text-sm.text-gray-700.leading-5 {
    color: var(--dark-gray) !important;
    font-weight: 500;
    font-size: 0.9rem;
}

.text-sm.text-gray-700.leading-5 .font-medium {
    color: var(--gold-dark);
    font-weight: 600;
}

/* Standard Bootstrap pagination (for other pages) */
.pagination {
    margin: 2rem 0;
}

.pagination .page-item .page-link {
    color: var(--gold-dark);
    border-color: rgba(212, 175, 55, 0.2);
    transition: all var(--transition-normal);
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0;
}

.pagination .page-item:first-child .page-link {
    border-top-left-radius: 50px;
    border-bottom-left-radius: 50px;
    padding-left: 1.2rem;
}

.pagination .page-item:last-child .page-link {
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
    padding-right: 1.2rem;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border-color: var(--gold-primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.pagination .page-item .page-link:hover {
    background-color: var(--gold-light);
    color: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.pagination .page-item.disabled .page-link {
    color: var(--medium-gray);
    background-color: var(--light-gray);
    border-color: rgba(212, 175, 55, 0.1);
}

/* Share Button in Header */
.btn-share-header {
    background-color: var(--gold-light);
    border: 1px solid var(--gold-primary);
    color: var(--gold-dark);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    font-weight: 400;
}

.btn-share-header:hover {
    background-color: var(--gold-primary);
    color: var(--white);
}

/* Responsive adjustments for header share button */
@media (max-width: 768px) {
    .btn-share-header {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

/* Accordion Button Styling - Remove Background Color */
.accordion-button {
    background-color: transparent !important;
    border: none !important;
}

.accordion-button:not(.collapsed) {
    background-color: transparent !important;
    box-shadow: none !important;
}

.accordion-button:focus {
    background-color: transparent !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.accordion-button:hover {
    background-color: rgba(212, 175, 55, 0.1) !important;
}

.accordion-button::after {
    filter: none;
}

/* Mobile Pagination Enhancements */
.mobile-pagination {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.mobile-pagination .pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    gap: 1rem;
}

.mobile-pagination .page-info {
    flex: 1;
    text-align: center;
    max-width: 250px;
}

.mobile-pagination .page-info .badge {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--white);
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    display: inline-block;
    min-width: 120px;
}

.mobile-pagination .page-info .small {
    color: var(--dark-gray);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.mobile-pagination .btn {
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-pagination .btn-outline-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border-color: var(--gold-primary);
    color: var(--white);
}

.mobile-pagination .btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

.mobile-pagination .btn-outline-secondary.disabled {
    background-color: var(--light-gray);
    border-color: var(--medium-gray);
    color: var(--medium-gray);
    opacity: 0.6;
    cursor: not-allowed;
}

.mobile-pagination .btn i {
    font-size: 0.9rem;
}

/* Desktop pagination numbers for larger screens */
.mobile-pagination .btn-group {
    background: var(--white);
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.mobile-pagination .btn-group .btn {
    border-radius: 0;
    min-width: 45px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
    margin: 0;
}

.mobile-pagination .btn-group .btn:first-child {
    border-top-left-radius: 50px;
    border-bottom-left-radius: 50px;
}

.mobile-pagination .btn-group .btn:last-child {
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
}

.mobile-pagination .btn-group .btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border-color: var(--gold-primary);
    color: var(--white);
}

.mobile-pagination .btn-group .btn-outline-secondary {
    background: var(--white);
    border-color: rgba(212, 175, 55, 0.2);
    color: var(--gold-dark);
}

.mobile-pagination .btn-group .btn-outline-secondary:hover {
    background: var(--gold-light);
    color: var(--gold-dark);
    transform: none;
}

.mobile-pagination .btn-group .btn-outline-secondary.disabled {
    background: var(--light-gray);
    color: var(--medium-gray);
    opacity: 0.5;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .mobile-pagination {
        margin: 1rem 0;
        padding: 0.75rem;
    }
    
    .mobile-pagination .pagination-wrapper {
        gap: 0.5rem;
        min-height: 50px;
    }
    
    .mobile-pagination .page-info .badge {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        min-width: 100px;
    }
    
    .mobile-pagination .page-info .small {
        font-size: 0.75rem;
    }
    
    .mobile-pagination .btn {
        padding: 0.5rem 0.75rem;
        min-width: 80px;
        font-size: 0.875rem;
    }
    
    .mobile-pagination .btn span {
        display: none;
    }
    
    .mobile-pagination .btn i {
        font-size: 1rem;
    }
}

/* Table responsive improvements for mobile */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
        box-shadow: var(--shadow-sm);
    }
    
    .table-gold {
        font-size: 0.8rem;
    }
    
    .table-gold th,
    .table-gold td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }
    
    .table-gold th {
        font-size: 0.75rem;
        font-weight: 600;
    }
    
}

/* Card improvements for mobile */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
        margin: 0;
    }
}

/* Improved touch targets for mobile */
@media (max-width: 768px) {
    .mobile-pagination .btn {
        min-height: 44px; /* iOS recommended touch target size */
    }
    
    .mobile-pagination .btn-group .btn {
        min-height: 40px;
        min-width: 40px;
    }
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background-color: var(--gold-primary);
    color: var(--white);
    border: none;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top-btn:hover {
    background-color: var(--gold-dark);
}

.back-to-top-btn i {
    font-size: 1.1rem;
}

/* Mobile optimization for back to top button */
@media (max-width: 768px) {
    .back-to-top-btn {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
}

/* ============================================
   Brand Tagline (Header navbar-brand)
   ============================================ */
.navbar-brand .brand-text-wrapper {
    vertical-align: middle;
}
.navbar-brand .brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
    color: inherit;
}
.navbar-brand .brand-tagline {
    font-size: 0.72rem;
    font-weight: 500;
    color: #5a4a1a;
    opacity: 1;
    margin-top: 2px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
@media (max-width: 575.98px) {
    .navbar-brand .brand-name {
        font-size: 0.98rem;
    }
    .navbar-brand .brand-tagline {
        font-size: 0.65rem;
    }
}

/* ============================================
   Sticky Gold Price Bar (moved from inline styles)
   ============================================ */
.sticky-gold-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1055;
    background: #fffdf5;
    border-bottom: 1px solid #e8d98a;
    box-shadow: 0 1px 6px rgba(184, 134, 11, 0.15);
    font-size: 0.8rem;
    padding: 0;
}

.sticky-gold-bar .sticky-bar-track {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sticky-bar-track::-webkit-scrollbar {
    display: none;
}

.sticky-gold-bar .sticky-bar-inner {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 5px 12px;
}

.sticky-gold-bar .sb-icon {
    color: #b8860b;
    margin-right: 6px;
}

.sticky-gold-bar .sb-type-label {
    color: #6b5a1e;
    font-weight: 600;
}

.sticky-gold-bar .sb-action-label {
    color: var(--dark-gray);
    margin: 0 3px;
}

.sticky-gold-bar .sb-action-label--sell {
    margin: 0 3px 0 0;
}

.sticky-gold-bar .sb-price-buy {
    color: var(--price-up);
}

.sticky-gold-bar .sb-price-sell {
    color: var(--price-down);
}

.sticky-gold-bar .sb-divider {
    color: var(--medium-gray);
    margin: 0 5px;
}

.sticky-gold-bar .sb-dot {
    color: #e8d98a;
    margin: 0 8px;
}

.sticky-gold-bar .sb-time {
    color: var(--dark-gray);
    font-size: 0.75rem;
}

/* Price flash animations (respect reduced-motion preference) */
.sb-flash-up   { animation: sbFlashUp   0.7s ease; }
.sb-flash-down { animation: sbFlashDown 0.7s ease; }
@keyframes sbFlashUp   { 0%, 100% { background: transparent; } 40% { background: rgba(5, 150, 105, 0.25); } }
@keyframes sbFlashDown { 0%, 100% { background: transparent; } 40% { background: rgba(220, 38, 38, 0.25); } }

@media (prefers-reduced-motion: reduce) {
    .sb-flash-up,
    .sb-flash-down {
        animation: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   Ad container — reserve space to prevent CLS
   ============================================ */
.ad-container {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767.98px) {
    .ad-container {
        min-height: 100px;
    }
}
