/**
 * GoldFactory.in - Core Design System & Styling
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,500&display=swap');

:root {
    /* Color Palette */
    --bg-primary: #0A1128;
    --bg-secondary: #131B2E;
    --bg-tertiary: #1B2644;
    
    --gold-primary: #D4AF37;
    --gold-secondary: #AA7C11;
    --gold-light: #FFDF73;
    --gold-glow: rgba(212, 175, 55, 0.2);
    
    --text-primary: #FFFFFF;
    --text-secondary: #B1B9C9;
    --text-muted: #6C7A9C;
    
    --success: #00E676;
    --danger: #FF1744;
    --warning: #FFC107;
    
    /* Layout Tokens */
    --font-sans: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-glass: 1px solid rgba(212, 175, 55, 0.15);
}

/* Light Mode Variables override */
body.light-theme {
    --bg-primary: #F4F6F9;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #E9ECEF;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border-glass: 1px solid rgba(170, 124, 17, 0.15);
}

/* Reset and Base Styles */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    transition: var(--transition-smooth);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
}

.serif-title {
    font-family: var(--font-serif);
    font-weight: 700;
}

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--gold-light);
}

/* Navigation & Header */
.navbar-custom {
    background-color: var(--bg-secondary);
    border-bottom: var(--border-glass);
    padding: 15px 0;
    transition: var(--transition-smooth);
}

.navbar-brand {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
}

.gold-logo-text {
    background: linear-gradient(135deg, #FFDF73 0%, #D4AF37 50%, #AA7C11 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link-custom {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 6px;
}

.nav-link-custom:hover, .nav-link-custom.active {
    color: var(--gold-primary) !important;
    background-color: rgba(212, 175, 55, 0.08);
}

/* Scroll Ticker */
.ticker-wrap {
    background: linear-gradient(90deg, #131B2E 0%, #1E294B 50%, #131B2E 100%);
    border-bottom: var(--border-glass);
    overflow: hidden;
    white-space: nowrap;
    padding: 10px 0;
    display: flex;
    align-items: center;
}

.ticker-title {
    background: var(--gold-primary);
    color: #0A1128;
    padding: 4px 12px;
    font-weight: 700;
    font-size: 12px;
    border-radius: 4px;
    margin-right: 15px;
    z-index: 10;
    text-transform: uppercase;
}

.ticker-content {
    display: inline-block;
    animation: ticker 40s linear infinite;
    padding-left: 100%;
}

.ticker-item {
    display: inline-block;
    padding: 0 25px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.ticker-item span {
    margin-left: 8px;
    font-weight: 700;
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* Premium Dashboard Cards */
.premium-card {
    background: var(--bg-secondary);
    border: var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.1);
    border-color: var(--gold-primary);
}

.premium-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: 0.5s;
    pointer-events: none;
}

.premium-card:hover::after {
    left: 100%;
}

/* Rates Display Widget */
.rate-widget-card {
    border-left: 4px solid var(--gold-primary) !important;
}

.rate-widget-card.silver-widget {
    border-left: 4px solid #C0C0C0 !important;
}

.rate-widget-card.platinum-widget {
    border-left: 4px solid #E5E4E2 !important;
}

.rate-change-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
}

.rate-change-badge.up {
    background-color: rgba(0, 230, 118, 0.15);
    color: var(--success);
}

.rate-change-badge.down {
    background-color: rgba(255, 23, 68, 0.15);
    color: var(--danger);
}

.rate-change-badge.neutral {
    background-color: rgba(181, 185, 201, 0.15);
    color: var(--text-secondary);
}

/* Table Design */
.table-custom {
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-custom th {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--bg-tertiary);
    padding: 12px 18px;
}

.table-custom tbody tr {
    background-color: var(--bg-secondary);
    transition: var(--transition-smooth);
}

.table-custom tbody tr:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.005);
}

.table-custom td {
    padding: 16px 18px;
    border: none;
}

.table-custom tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.table-custom tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Calculators */
.calc-input-group {
    background-color: var(--bg-tertiary);
    border: var(--border-glass);
    border-radius: 8px;
    padding: 10px 15px;
}

.calc-input-group label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.calc-input-group input, .calc-input-group select {
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    width: 100%;
}

.calc-input-group input:focus, .calc-input-group select:focus {
    outline: none;
}

/* AI Prediction Gauge */
.gauge-wrapper {
    position: relative;
    width: 180px;
    height: 90px;
    margin: 20px auto;
    overflow: hidden;
}

.gauge-body {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.gauge-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 180px;
    height: 90px;
    border-radius: 90px 90px 0 0;
    transform-origin: center bottom;
    transition: transform 1s ease-out;
}

.gauge-fill.bullish {
    background: linear-gradient(to right, var(--warning), var(--success));
}

.gauge-fill.bearish {
    background: linear-gradient(to right, var(--warning), var(--danger));
}

.gauge-cover {
    position: absolute;
    width: 140px;
    height: 70px;
    background: var(--bg-secondary);
    border-radius: 70px 70px 0 0;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 5px;
}

.gauge-value {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 24px;
    color: var(--text-primary);
}

/* News Section Cards */
.news-card-img {
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.badge-category {
    background-color: var(--gold-glow);
    color: var(--gold-primary);
    border: 1px solid rgba(212,175,55,0.4);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 30px;
}

/* Advertisement Styles */
.ad-placeholder {
    transition: var(--transition-smooth);
}

.ad-placeholder:hover {
    background-color: rgba(212, 175, 55, 0.05) !important;
}

/* Layout Details */
.footer-custom {
    background-color: #050A19;
    border-top: var(--border-glass);
    padding: 60px 0 30px;
    color: var(--text-secondary);
}

.footer-custom h5 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-link {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

.footer-link:hover {
    color: var(--gold-primary);
    padding-left: 5px;
}

/* Custom UI Components buttons */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-secondary) 100%);
    color: #0A1128;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    transition: var(--transition-smooth);
}

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

/* Scroll To Top */
.scroll-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: var(--gold-primary);
    color: #0A1128;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
}

/* Admin Dashboard layout tweaks */
.admin-sidebar {
    background-color: #050A19;
    border-right: var(--border-glass);
    min-height: calc(100vh - 70px);
}

.admin-nav-link {
    color: var(--text-secondary);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.admin-nav-link:hover, .admin-nav-link.active {
    color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.05);
    border-left: 4px solid var(--gold-primary);
}

.admin-nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* ==========================================================================
   Admin Form Controls and Inputs Overrides (Professional Theme Integration)
   ========================================================================== */

/* Define .bg-tertiary class to map to the CSS variable */
.bg-tertiary {
    background-color: var(--bg-tertiary) !important;
}

/* Global Form Controls Styling */
.form-control,
.form-select,
.form-control-color {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    border-radius: 8px !important;
    padding: 10px 16px !important;
    transition: var(--transition-smooth) !important;
}

/* Focus and Active States */
.form-control:focus,
.form-select:focus {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 0 0.25rem var(--gold-glow) !important;
    outline: none !important;
}

/* Dropdown styling (form-select options) */
.form-select {
    /* Custom Gold Chevron dropdown indicator arrow */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23D4AF37' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-size: 14px 14px !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    padding-right: 40px !important;
}

.form-select option {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    padding: 10px !important;
}

/* Ensure browser default input color pickers look premium */
.form-control-color {
    padding: 4px !important;
    height: 46px !important;
    cursor: pointer;
}

.form-control-color::-webkit-color-swatch-wrapper {
    padding: 0 !important;
}

.form-control-color::-webkit-color-swatch {
    border-radius: 6px !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
}

.form-control-color::-moz-color-swatch {
    border-radius: 6px !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
}

/* Readability styling for Textareas and Monospace code editors */
textarea.form-control {
    line-height: 1.5 !important;
}

textarea.form-control.text-warning {
    color: var(--gold-light) !important;
}

/* Placeholder adjustments */
.form-control::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.75 !important;
}

/* Disabled Form Elements */
.form-control:disabled,
.form-select:disabled {
    background-color: rgba(27, 38, 68, 0.5) !important;
    color: var(--text-muted) !important;
    border-color: rgba(212, 175, 55, 0.1) !important;
    cursor: not-allowed;
}

/* ==========================================================================
   Admin Blue and White Theme Overrides (Professional Theme Integration)
   ========================================================================== */

body.admin-body {
    /* Color Palette Overrides for White & Blue Theme */
    --bg-primary: #F3F4F6;       /* Soft light-gray background */
    --bg-secondary: #FFFFFF;     /* White card background */
    --bg-tertiary: #E5E7EB;      /* Light border/input background */
    
    --gold-primary: #3B82F6;     /* Bright blue primary (accent/buttons) */
    --gold-secondary: #2563EB;   /* Darker blue hover (buttons) */
    --gold-light: #60A5FA;       /* Light blue borders/glow highlights */
    --gold-glow: rgba(59, 130, 246, 0.15);
    
    --text-primary: #1F2937;     /* Dark gray/black primary text */
    --text-secondary: #4B5563;   /* Slate gray secondary text */
    --text-muted: #9CA3AF;       /* Muted gray info text */
    
    --border-glass: 1px solid #E5E7EB;
}

/* Border overrides global */
body.admin-body .border-secondary {
    border-color: #E5E7EB !important;
}

/* Top Navbar Style (Solid Professional Blue) */
body.admin-body .navbar-custom {
    background-color: #1E3A8A !important; /* Deep Navy Blue */
    border-bottom: 2px solid #172554 !important;
}

body.admin-body .navbar-brand .gold-logo-text {
    /* Keep brand name recognizable in white-gold contrast */
    background: linear-gradient(135deg, #FFFFFF 0%, #F59E0B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.admin-body .navbar-custom .text-white {
    color: #FFFFFF !important;
}

body.admin-body .navbar-custom .text-light {
    color: #E2E8F0 !important;
}

body.admin-body .navbar-custom .text-warning {
    color: #FBBF24 !important; /* Amber / gold icon */
}

/* Sidebar Navigation Layout (Clean White with Blue Accent) */
body.admin-body .admin-sidebar {
    background-color: #FFFFFF !important;
    border-right: 1px solid #E5E7EB !important;
}

body.admin-body .admin-nav-link {
    color: #4B5563 !important;
    border-left: 4px solid transparent;
}

body.admin-body .admin-nav-link:hover, 
body.admin-body .admin-nav-link.active {
    color: #2563EB !important;
    background-color: rgba(37, 99, 235, 0.08) !important;
    border-left-color: #2563EB !important;
}

body.admin-body .admin-nav-link i {
    color: #4B5563;
}

body.admin-body .admin-nav-link:hover i, 
body.admin-body .admin-nav-link.active i {
    color: #2563EB !important;
}

/* Main Content Text Adjustments (Light Theme readability overrides) */
body.admin-body main .text-white,
body.admin-body .premium-card h2.text-white,
body.admin-body .premium-card h4.text-white {
    color: #1F2937 !important; /* Dark text for headings */
}

body.admin-body main .text-muted,
body.admin-body .premium-card .text-muted {
    color: #4B5563 !important; /* Muted slate gray */
}

body.admin-body main .text-light,
body.admin-body .premium-card .text-light {
    color: #6B7280 !important; /* Muted gray body descriptions */
}

body.admin-body main .border-secondary {
    border-color: #E5E7EB !important;
}

body.admin-body main hr {
    border-color: #E5E7EB !important;
}

body.admin-body main .text-warning,
body.admin-body .premium-card .text-warning {
    color: #2563EB !important; /* Blue icons instead of gold */
}

/* Card layout adjustments */
body.admin-body .premium-card {
    background-color: #FFFFFF !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #E5E7EB !important;
}

body.admin-body .premium-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1), 0 4px 6px -2px rgba(37, 99, 235, 0.05);
    border-color: #3B82F6 !important;
}

/* Form inputs adjustments */
body.admin-body .form-control,
body.admin-body .form-select,
body.admin-body .form-control-color {
    background-color: #FFFFFF !important;
    color: #1F2937 !important;
    border: 1px solid #D1D5DB !important;
}

body.admin-body .form-control:focus,
body.admin-body .form-select:focus {
    background-color: #FFFFFF !important;
    color: #1F2937 !important;
    border-color: #3B82F6 !important;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.2) !important;
}

body.admin-body .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%232563EB' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    padding-right: 40px !important;
}

body.admin-body .form-select option {
    background-color: #FFFFFF !important;
    color: #1F2937 !important;
}

/* Color Pickers swatches inside light theme */
body.admin-body .form-control-color::-webkit-color-swatch {
    border: 1px solid #D1D5DB !important;
}

body.admin-body .form-control-color::-moz-color-swatch {
    border: 1px solid #D1D5DB !important;
}

/* Table Light style overrides */
body.admin-body .table-dark {
    --bs-table-color: #1F2937 !important;
    --bs-table-bg: #FFFFFF !important;
    --bs-table-striped-color: #1F2937 !important;
    --bs-table-striped-bg: #F9FAFB !important;
    --bs-table-border-color: #E5E7EB !important;
    border-color: #E5E7EB !important;
    color: #1F2937 !important;
}

body.admin-body .table-dark tr th {
    background-color: #F3F4F6 !important;
    color: #4B5563 !important;
    border-bottom: 2px solid #E5E7EB !important;
}

body.admin-body .table-dark tr td {
    background-color: #FFFFFF !important;
    color: #1F2937 !important;
    border-bottom: 1px solid #E5E7EB !important;
}

body.admin-body .table-dark tbody tr:nth-of-type(odd) td {
    background-color: #F9FAFB !important;
}

body.admin-body .table-custom tbody tr {
    background-color: #FFFFFF !important;
}

body.admin-body .table-custom tbody tr:hover {
    background-color: #F3F4F6 !important;
}

/* Code block descriptions */
body.admin-body .bg-tertiary.p-3.rounded-4 {
    background-color: #F3F4F6 !important;
    border: 1px solid #E5E7EB !important;
    color: #1F2937 !important;
}

body.admin-body .bg-tertiary.p-3.rounded-4 code {
    color: #B91C1C !important; /* red for code values in light mode */
}

/* Custom textareas formatting */
body.admin-body textarea.form-control.text-warning {
    color: #D97706 !important; /* dark yellow/orange for monospace text in light mode */
    background-color: #F9FAFB !important;
}

/* Buttons theme adjustment */
body.admin-body .btn-gold {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    color: #FFFFFF !important;
}

body.admin-body .btn-gold:hover {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}

body.admin-body .btn-outline-warning {
    color: #2563EB !important;
    border-color: #3B82F6 !important;
}

body.admin-body .btn-outline-warning:hover {
    background-color: #2563EB !important;
    color: #FFFFFF !important;
}

/* =========================================================
   LIVE PRECIOUS METALS TICKER
   ========================================================= */
.precious-metals-ticker {
    background: #0d1527;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.ticker-icon-badge {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold-primary);
    padding: 6px 12px;
    font-size: 16px;
    border-radius: 6px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ticker-content-container {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}

.ticker-content.scrolling {
    display: inline-block;
    animation: ticker 35s linear infinite;
    padding-left: 100%;
}

.ticker-content.static {
    display: flex;
    flex-wrap: wrap;
    white-space: normal;
    padding-left: 0;
    animation: none;
}

.ticker-text-item {
    display: inline-block;
    padding: 0 20px;
    color: #cbd5e1;
    font-size: 13.5px;
    font-weight: 500;
}

.ticker-text-item .price-change.up {
    color: #00E676 !important; /* Green up arrow */
    font-weight: bold;
    margin-left: 4px;
}

.ticker-text-item .price-change.down {
    color: #FF1744 !important; /* Red down arrow */
    font-weight: bold;
    margin-left: 4px;
}

.ticker-text-item .price-change.neutral {
    color: #94a3b8 !important;
    margin-left: 4px;
}

.ticker-last-updated {
    color: #94a3b8 !important;
    font-size: 12.5px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.ticker-emoji {
    font-size: 14px;
    vertical-align: middle;
}
