/* PublicGold Color Scheme - Matching Official Website */

:root {
    --pg-red: #A0522D;
    --pg-red-dark: #8B4513;
    --pg-gold: #F4D03F;
    --pg-gold-dark: #D4AC0D;
    --bnd-blue: #0066CC;
    --bnd-blue-light: #E6F2FF;
    --myr-green: #22A852;
    --myr-green-light: #E8F5E8;
    --header-dark: #2C3E50;
    --bg-gray: #F5F5F5;
    --white: #FFFFFF;
    --border-light: #CCC;
    --border-gray: #B8B8B8;
    --text-dark: #333;
    --text-light: #666;
}

body {
    background-color: var(--bg-gray);
    color: var(--text-dark);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--pg-red) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--pg-red-dark) !important;
    text-decoration: none;
}

.navbar-brand .trademark-text {
    font-size: 0.65rem;
    font-weight: 400;
    color: #6c757d !important;
    margin-top: -2px;
    line-height: 1.2;
}

.card {
    border: 1px solid var(--border-gray);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    background-color: var(--white);
    color: var(--text-dark);
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    background-color: #F8F9FA;
    color: var(--text-dark) !important;
    border-bottom: 1px solid var(--border-gray);
    font-weight: 600;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    text-align: left;
}

.card-header h4 {
    color: var(--text-dark) !important;
    margin: 0;
    font-weight: 700;
}

.table {
    margin-bottom: 0;
    background-color: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-gray);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background-color: #F8F9FA;
    color: var(--text-dark) !important;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid var(--border-gray);
    border-top: none;
    padding: 0.75rem 1rem;
    text-align: center;
    vertical-align: middle;
}

.table th:first-child {
    border-left: none;
    text-align: left;
}

.table th:last-child {
    border-right: none;
}

.table td {
    background-color: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-gray);
    border-top: none;
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 500;
    vertical-align: middle;
}

.table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-left: none;
}

.table td:last-child {
    border-right: none;
}

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

.table tbody tr:nth-child(even) td {
    background-color: #FDFDFD;
}

.table-hover tbody tr:hover td {
    background-color: #F5F5F5 !important;
    transition: all 0.2s ease-in-out;
}

.text-success {
    color: var(--pg-success) !important;
    font-weight: 700;
}

.text-info {
    color: var(--pg-blue-light) !important;
    font-weight: 700;
}

.text-warning {
    color: var(--pg-gold-dark) !important;
    font-weight: 700;
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

.btn {
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
    padding: 0.5rem 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-outline-secondary {
    color: var(--pg-red);
    border-color: var(--pg-red);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--pg-red);
    border-color: var(--pg-red);
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pg-blue) 0%, var(--pg-navy) 100%);
    border-color: var(--pg-blue);
    color: var(--pg-white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--pg-navy) 0%, var(--pg-blue) 100%);
    border-color: var(--pg-gold);
}

.card.bg-primary {
    background: linear-gradient(135deg, var(--pg-blue) 0%, var(--pg-navy) 100%) !important;
    border: 2px solid var(--pg-gold);
    color: var(--pg-white) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-responsive {
    border-radius: 0.375rem;
}

.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    background-color: var(--bs-secondary);
    border-color: var(--bs-border-color);
}

footer {
    margin-top: auto;
}

/* Responsive improvements - Optimize for mobile */
@media (max-width: 768px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    /* Compact table layout for mobile */
    .table th {
        font-size: 0.7rem;
        padding: 0.6rem 0.2rem;
        line-height: 1.1;
        word-wrap: break-word;
    }
    
    .table td {
        font-size: 0.7rem;
        padding: 0.6rem 0.2rem;
        line-height: 1.2;
        word-wrap: break-word;
        white-space: normal;
    }
    
    .table td:first-child {
        font-size: 0.7rem;
        font-weight: 600;
        min-width: 80px;
    }
    
    /* Optimized column widths for mobile - fit all data nicely */
    .table th:nth-child(1), /* Item */
    .table td:nth-child(1) {
        width: 20%;
        min-width: 65px;
    }
    
    .table th:nth-child(2), /* GP */
    .table td:nth-child(2) {
        width: 14%;
        min-width: 50px;
    }
    
    .table th:nth-child(3), /* PG SELL */
    .table td:nth-child(3) {
        width: 20%;
        min-width: 65px;
    }
    
    .table th:nth-child(4), /* PRICE MYR */
    .table td:nth-child(4) {
        width: 23%;
        min-width: 75px;
    }
    
    .table th:nth-child(5), /* PRICE BND */
    .table td:nth-child(5) {
        width: 23%;
        min-width: 75px;
    }
    
    /* Allow headers to wrap to multiple lines on mobile */
    .table th {
        white-space: normal;
        word-wrap: break-word;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.1;
        hyphens: auto;
    }
    
    .card-header {
        padding: 0.8rem 0.5rem;
        font-size: 1rem;
    }
    
    .card-header h4 {
        font-size: 0.9rem;
        margin: 0;
    }
    
    /* Section headers */
    h2.section-header {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    /* Contact information responsive */
    .d-flex.gap-4 {
        gap: 1rem !important;
        font-size: 0.9rem;
    }
    
    /* Live prices info box */
    .alert {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Remove horizontal scrolling */
    .table-responsive {
        overflow-x: visible;
    }
    
    /* Force table to fit width */
    .table {
        table-layout: fixed;
        width: 100%;
        min-width: 100%;
    }
    
    /* Price colors remain strong on mobile - smaller font for better fit */
    .table tbody tr td.myr-price {
        font-size: 0.65rem;
    }
    
    .table tbody tr td.bnd-price {
        font-size: 0.65rem;
    }
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* MYR Green and BND Blue Price Styling */
.table tbody tr td.myr-price {
    color: var(--myr-green) !important;
    font-weight: 700;
    font-size: 0.95rem;
}

.table tbody tr td.bnd-price {
    color: var(--bnd-blue) !important;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Currency symbols */
.currency-symbol {
    font-weight: 700;
}

.myr-symbol {
    color: var(--myr-green);
}

.bnd-symbol {
    color: var(--bnd-blue);
}

/* Section headers */
h2.section-header {
    color: var(--text-dark);
    font-weight: 700;
    border-bottom: 3px solid var(--pg-red);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Admin dashboard specific styles */
.admin-stats {
    background: linear-gradient(135deg, var(--bs-info) 0%, #0dcaf0 100%);
}

/* Custom scrollbar for tables */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 4px;
}

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

/* PublicGold Header Card */
.pg-header-card {
    background-color: var(--pg-red) !important;
    color: white !important;
    border: none !important;
    margin-bottom: 2rem;
}

.pg-header-card .card-body {
    padding: 2rem 1.25rem;
}

/* PublicGold Table Headers - Red like AKAUN EMAS GAP 24K */
.pg-red-header {
    background-color: var(--pg-red) !important;
    color: white !important;
    font-weight: 700;
    text-align: center;
    padding: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Alternative gold header for product sections */
.pg-gold-header {
    background-color: var(--pg-gold) !important;
    color: var(--text-dark) !important;
    font-weight: 700;
}
