/* STYLE.CSS */
/* PURPOSE: RESPONSIVE STYLESHEET FOR Z.Z. PRECIOUS METALS WEBSITE WITH LIGHT/DARK THEME */

/* GLOBAL RESET AND BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* LIGHT THEME (DEFAULT) */
:root {
    --bg-primary: #f4f4f4;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #dddddd;
    --header-bg: linear-gradient(135deg, #1a5490 0%, #2c3e50 100%);
    --header-text: #ffffff;
    --gold-bg: #fff9e6;
    --gold-border: #DAA520;
    --silver-bg: #f5f5f5;
    --silver-border: #C0C0C0;
    --positive: #28a745;
    --negative: #dc3545;
    --neutral: #6c757d;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* DARK THEME */
body.dark-theme {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #444444;
    --header-bg: linear-gradient(135deg, #0d3a5f 0%, #1a1a1a 100%);
    --header-text: #e0e0e0;
    --gold-bg: #2d2816;
    --gold-border: #DAA520;
    --silver-bg: #2d2d2d;
    --silver-border: #C0C0C0;
    --positive: #4ade80;
    --negative: #f87171;
    --neutral: #9ca3af;
    --shadow: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* HEADER STYLES */
header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 1.5rem 0;
    box-shadow: 0 2px 5px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-title {
    text-align: center;
    flex: 1;
}

.header-title h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.header-title .location {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

/* HAMBURGER MENU BUTTON */
.hamburger-menu {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    z-index: 101;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: var(--header-text);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-menu:hover span {
    background-color: #DAA520;
}

/* THEME TOGGLE BUTTON */
.theme-toggle {
    background: none;
    border: 2px solid var(--header-text);
    border-radius: 20px;
    cursor: pointer;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--header-text);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.dark-theme .moon-icon {
    display: none;
}

.sun-icon {
    display: none;
}

.dark-theme .sun-icon {
    display: inline;
}

body:not(.dark-theme) .moon-icon {
    display: inline;
}

/* SIDE NAVIGATION */
.side-nav {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--bg-secondary);
    box-shadow: 2px 0 10px var(--shadow);
    transition: left 0.3s ease;
    z-index: 200;
    overflow-y: auto;
}

.side-nav.active {
    left: 0;
}

.side-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.side-nav-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.close-menu {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-menu:hover {
    color: #dc3545;
}

.nav-links {
    list-style: none;
    padding: 0;
}

.nav-links li {
    border-bottom: 1px solid var(--border-color);
}

.nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.nav-links a:hover {
    background-color: var(--bg-primary);
    color: #DAA520;
}

/* OVERLAY */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 150;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* MAIN CONTENT STYLES */
main {
    flex: 1;
    padding: 2rem 0;
}

main h2 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.last-update {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* LOADING AND ERROR STYLES */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid rgba(220, 53, 69, 0.3);
    text-align: center;
}

/* DESKTOP/MOBILE VISIBILITY */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

/* TABBED CARD FOR MOBILE */
.tabbed-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow);
    overflow: hidden;
}

.card-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
}

.card-tab {
    flex: 1;
    background: var(--bg-secondary);
    border: none;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.card-tab.active {
    color: var(--text-primary);
    background: var(--bg-primary);
}

.card-tab:first-child.active {
    background: var(--gold-bg);
    border-bottom-color: var(--gold-border);
}

.card-tab:last-child.active {
    background: var(--silver-bg);
    border-bottom-color: var(--silver-border);
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

.gold-content {
    background: var(--gold-bg);
}

.silver-content {
    background: var(--silver-bg);
}

/* PRICE ROWS CONTAINER */
.price-rows {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* PRICE ROW STYLES */
.price-row {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--shadow);
    border-left: 5px solid;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.price-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow);
}

.gold-row {
    border-left-color: var(--gold-border);
    background: var(--gold-bg);
}

.silver-row {
    border-left-color: var(--silver-border);
    background: var(--silver-bg);
}

.metal-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.price-data {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.data-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.data-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* POSITIVE AND NEGATIVE VALUE COLORS */
.positive {
    color: var(--positive) !important;
}

.negative {
    color: var(--negative) !important;
}

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

/* FOOTER STYLES */
footer {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

footer p {
    margin-bottom: 0.5rem;
}

footer .disclaimer {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* RESPONSIVE DESIGN - TABLET */
@media (max-width: 768px) {
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .header-title .location {
        font-size: 0.8rem;
    }
    
    main h2 {
        font-size: 1.5rem;
    }
    
    .price-data {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metal-name {
        font-size: 1.3rem;
    }
    
    .data-value {
        font-size: 1.1rem;
    }
}

/* RESPONSIVE DESIGN - MOBILE */
@media (max-width: 480px) {
    /* SHOW MOBILE, HIDE DESKTOP */
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    header {
        padding: 1rem 0;
    }
    
    .header-title h1 {
        font-size: 1.2rem;
    }
    
    .header-title .location {
        font-size: 0.75rem;
    }
    
    main {
        padding: 1.5rem 0;
    }
    
    main h2 {
        font-size: 1.3rem;
    }
    
    .price-data {
        grid-template-columns: 1fr;
        width: 100%;
    }
    
    .price-row {
        padding: 1rem;
    }
    
    .metal-name {
        font-size: 1.4rem;
        text-align: center;
    }
    
    .data-label {
        font-size: 1.1rem;
        text-align: center;
    }
    
    .data-value {
        font-size: 1.5rem;
        text-align: center;
    }
    
    footer {
        padding: 1.5rem 0;
        font-size: 0.9rem;
    }
    
    .side-nav {
        width: 250px;
        left: -250px;
    }
}