/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #f59e0b;
    --secondary-color: #1f2937;
    --accent-color: #3b82f6;
    --background-color: #111827;
    --surface-color: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --hover-bg: #374151;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    --gold-color: #ffd700;
    --silver-color: #c0c0c0;
    --platinum-color: #e5e7eb;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--surface-color) 0%, #2d3748 100%);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    z-index: 101;
}

.nav-brand i {
    font-size: 1.5rem;
}

.nav-brand small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background-color: rgba(245, 158, 11, 0.1);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle,
.lang-toggle {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover,
.lang-toggle:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dropdown Navigation */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .nav-link {
    position: relative;
}

.nav-dropdown .nav-link::after {
    content: '▼';
    font-size: 0.7rem;
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .nav-link::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu .nav-link:last-child {
    border-bottom: none;
}

.dropdown-menu .nav-link:hover {
    background-color: var(--hover-bg);
}

/* Mobile Responsive Header */
@media (max-width: 768px) {
    .nav {
        padding: 1rem;
    }
    
    .nav-brand span {
        font-size: 1.1rem;
    }
    
    .nav-brand small {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: var(--surface-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: left 0.3s ease;
        z-index: 100;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-link {
        font-size: 1.2rem;
        padding: 1rem 2rem;
        width: 200px;
        text-align: center;
        justify-content: center;
    }
    
    .nav-controls {
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        flex-direction: column;
        gap: 0.5rem;
        z-index: 101;
    }
    
    .theme-toggle,
    .lang-toggle {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-lg);
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        margin-top: 1rem;
    }
}

/* Main Content */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Sections */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 4rem 0;
    min-height: 60vh;
}

.hero-small {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.5) 0%, rgba(17, 24, 39, 0.8) 100%);
    border-radius: var(--border-radius-lg);
    margin: 2rem 0;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #f97316 100%);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gold-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: perspective(1000px) rotateX(15deg) rotateY(-15deg);
}

.gold-bar {
    width: 300px;
    height: 80px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #fbbf24 100%);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    animation: float 6s ease-in-out infinite;
}

.gold-bar:nth-child(2) {
    animation-delay: -3s;
    transform: translateX(50px);
}

.gold-bar::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    50% { transform: translateY(-10px) translateX(5px); }
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Rates Section */
.rates-section {
    padding: 4rem 0;
}

.last-updated {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.country-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.country-selector select {
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 1rem;
    min-width: 300px;
    cursor: pointer;
    transition: var(--transition);
}

.country-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.metals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.metal-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.metal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

.gold-card::before { background: var(--gold-color); }
.silver-card::before { background: var(--silver-color); }
.platinum-card::before { background: var(--platinum-color); }

.metal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.metal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.metal-icon {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metal-icon i {
    font-size: 1.5rem;
}

.gold-icon { color: var(--gold-color); }
.silver-icon { color: var(--silver-color); }
.platinum-icon { color: var(--platinum-color); }

.metal-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.metal-unit {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.weight-selector {
    margin-bottom: 2rem;
}

.weight-selector select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background-color);
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.weight-type {
    display: flex;
    gap: 1rem;
}

.weight-type label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.price-display {
    text-align: center;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.price-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.price-change {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
}

.price-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.price-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.market-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--border-radius-lg);
    text-align: center;
}

.market-status i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Converter Section */
.converter-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.5) 0%, rgba(17, 24, 39, 0.8) 100%);
    border-radius: var(--border-radius-lg);
    margin: 2rem 0;
}

.converter-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

.converter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.converter-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.converter-form {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group select,
.input-group input {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.swap-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-button button {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-button button:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: rotate(180deg);
}

.convert-btn {
    grid-column: 1 / -1;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #f97316 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.conversion-result {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(251, 191, 36, 0.02) 100%);
    border: 1px solid rgba(245, 158, 11, 0.1);
    border-radius: var(--border-radius-lg);
}

.result-display {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.exchange-rate {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Charts Section */
.main-chart-section {
    padding: 4rem 0;
}

.chart-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.metal-selector .metal-btn,
.timeframe-selector .timeframe-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metal-selector .metal-btn:hover,
.timeframe-selector .timeframe-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.metal-selector .metal-btn.active,
.timeframe-selector .timeframe-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-type-selector select {
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

/* Chart Containers - Fixed Sizing */
.chart-container {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    margin: 2rem 0;
    position: relative;
    height: 400px;
    max-width: 100%;
    overflow: hidden;
}

.main-chart-container {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    height: 450px;
    position: relative;
    margin: 2rem 0;
}

.comparison-chart-container {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    height: 350px;
    position: relative;
    margin: 2rem 0;
}

/* Canvas Styling */
canvas {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

#price-chart {
    max-height: 300px !important;
}

#main-price-chart {
    max-height: 400px !important;
}

#comparison-chart {
    max-height: 280px !important;
}

#analysis-price-chart {
    max-height: 350px !important;
}

#analysis-volume-chart {
    max-height: 250px !important;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-title span {
    font-size: 1.2rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.chart-title .positive {
    color: var(--success-color);
}

.chart-title .negative {
    color: var(--error-color);
}

.chart-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Technical Analysis Section */
.technical-analysis-section {
    padding: 4rem 0;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.analysis-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.analysis-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.indicator-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.indicator-item:last-child {
    border-bottom: none;
}

.indicator-item span {
    color: var(--text-secondary);
}

.indicator-item span:first-child {
    font-weight: 500;
}

.signal {
    font-weight: 600;
}

.signal.bullish { color: var(--success-color); }
.signal.bearish { color: var(--error-color); }
.signal.neutral { color: var(--text-secondary); }

.sentiment-meter {
    margin-top: 1rem;
}

.sentiment-bar {
    background: var(--border-color);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.sentiment-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--error-color) 0%, var(--success-color) 100%);
    border-radius: 5px;
}

.sentiment-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.sentiment-value {
    text-align: center;
    font-weight: 600;
    margin-top: 1rem;
    color: var(--text-primary);
}

/* Analysis Page Specific Styles */
.market-overview-section {
    padding: 4rem 0;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.overview-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.overview-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.card-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.trend-indicator.bullish {
    color: var(--success-color);
}

.trend-indicator.bearish {
    color: var(--error-color);
}

.sentiment-gauge {
    background: var(--border-color);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--error-color) 0%, var(--success-color) 100%);
    border-radius: 4px;
}

.volume-indicator,
.volatility-indicator {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.volume-indicator.high {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.volatility-indicator.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.analysis-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.analysis-tab {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.analysis-tab:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.analysis-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.analysis-content {
    position: relative;
}

.analysis-panel {
    display: none;
}

.analysis-panel.active {
    display: block;
}

.indicator-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.indicator-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.indicator-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}

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

.sr-levels {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sr-level {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.sr-level.resistance {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.sr-level.support {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.sr-level.current {
    background: rgba(245, 158, 11, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.pattern-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pattern-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.pattern-item i {
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.pattern-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.pattern-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.analysis-summary {
    margin-top: 3rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.analysis-summary h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-signal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
}

.summary-signal.bullish {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.summary-signal.bearish {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.summary-signal.neutral {
    background: rgba(156, 163, 175, 0.1);
    color: var(--text-secondary);
}

/* Comparison Charts Section */
.comparison-section {
    padding: 4rem 0;
}

.comparison-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.comparison-timeframe .comparison-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.comparison-timeframe .comparison-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

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

.performance-table {
    margin-top: 3rem;
    overflow-x: auto;
}

.performance-table table {
    width: 100%;
    border-collapse: collapse;
}

.performance-table th,
.performance-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.performance-table th {
    background: var(--surface-color);
    color: var(--text-primary);
    font-weight: 600;
}

.performance-table td {
    color: var(--text-secondary);
}

.performance-table td i {
    margin-right: 0.5rem;
}

.performance-table .positive { color: var(--success-color); }
.performance-table .negative { color: var(--error-color); }

/* Market News Section */
.market-news-section {
    padding: 4rem 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.news-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.news-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.news-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.news-impact {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    display: inline-block;
}

.news-impact.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.news-impact.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.news-timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.news-item {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.news-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 120px;
}

.news-content {
    flex: 1;
}

.news-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.news-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 1.6;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive adjustments for charts */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .metal-selector,
    .timeframe-selector {
        width: 100%;
        justify-content: center;
    }
    
    .chart-type-selector select {
        width: 100%;
    }
    
    .main-chart-container,
    .comparison-chart-container {
        height: 350px;
        padding: 1rem;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .analysis-grid,
    .news-grid,
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .converter-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .swap-button {
        order: 2;
    }
    
    .metals-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .analysis-tab {
        width: 200px;
        text-align: center;
    }
    
    .news-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .news-time {
        min-width: auto;
    }
}

/* Print styles */
@media print {
    .nav-controls,
    .mobile-menu-toggle,
    .hero-cta {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .main-chart-container,
    .comparison-chart-container {
        break-inside: avoid;
    }
}



/* Advertisement Spaces */
.ad-space-header,
.ad-space-inline,
.ad-space-sidebar,
.ad-space-footer {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    transition: var(--transition);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ad-space-header:hover,
.ad-space-inline:hover,
.ad-space-sidebar:hover,
.ad-space-footer:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(31, 41, 55, 0.8) 100%);
}

.ad-space-header {
    max-width: 728px;
    height: 90px;
    margin: 1rem auto;
}

.ad-space-inline {
    max-width: 320px;
    height: 100px;
    margin: 2rem auto;
}

.ad-space-sidebar {
    max-width: 300px;
    height: 250px;
    margin: 1rem 0;
}

.ad-space-footer {
    max-width: 970px;
    height: 90px;
    margin: 2rem auto;
}

.ad-space-header i,
.ad-space-inline i,
.ad-space-sidebar i,
.ad-space-footer i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.ad-space-header div,
.ad-space-inline div,
.ad-space-sidebar div,
.ad-space-footer div {
    font-weight: 600;
    font-size: 1.1rem;
}

.ad-space-header small,
.ad-space-inline small,
.ad-space-sidebar small,
.ad-space-footer small {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Tool Pages Styling */
.tool-section {
    padding: 3rem 0;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    margin: 2rem 0;
}

.tool-card {
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}

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

.tool-header h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tool-header i {
    font-size: 1.5rem;
}

.tool-form {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: end;
    margin-bottom: 2rem;
}

.tool-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-input-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.tool-input-group input,
.tool-input-group select {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: rgba(31, 41, 55, 0.5);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.tool-input-group input:focus,
.tool-input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.tool-swap-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-swap-button button {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: var(--background-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-swap-button button:hover {
    background: #d97706;
    transform: rotate(180deg);
}

.tool-result {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
}

.tool-result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.tool-result-formula {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Tool Examples Section */
.tool-examples {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.tool-examples h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

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

.example-item {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.example-item:hover {
    border-color: var(--primary-color);
    background: rgba(245, 158, 11, 0.1);
}

.example-conversion {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.example-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Responsive Design for Tools */
@media (max-width: 768px) {
    .tool-form {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-swap-button {
        order: 2;
        margin: 1rem 0;
    }
    
    .tool-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
}



/* Improved Alignment and Layout */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Code and Technical Elements Styling */
code, .code {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
    display: inline-block;
}

pre {
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

/* Table Styling Improvements */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

table th {
    background: linear-gradient(135deg, var(--primary-color) 0%, #d97706 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

table tr:hover {
    background: rgba(245, 158, 11, 0.05);
}

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

/* Grid Layout Improvements */
.metals-grid,
.features-grid,
.overview-grid,
.analysis-grid {
    display: grid;
    gap: 2rem;
    margin: 3rem 0;
    align-items: stretch;
}

.metals-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.features-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.analysis-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Card Alignment and Spacing */
.metal-card,
.feature-card,
.overview-card,
.analysis-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
}

.metal-card:hover,
.feature-card:hover,
.overview-card:hover,
.analysis-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Button Alignment and Styling */
.btn, button, .hero-cta, .convert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
    white-space: nowrap;
}

.btn-primary, .hero-cta, .convert-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #d97706 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover, .hero-cta:hover, .convert-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Form Element Alignment */
.input-group,
.tool-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-group label,
.tool-input-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.input-group input,
.input-group select,
.tool-input-group input,
.tool-input-group select {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: rgba(31, 41, 55, 0.5);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    min-height: 44px;
}

.input-group input:focus,
.input-group select:focus,
.tool-input-group input:focus,
.tool-input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    background: rgba(31, 41, 55, 0.8);
}

/* Navigation Alignment */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    background: rgba(245, 158, 11, 0.1);
}

/* Price Display Alignment */
.price-display {
    text-align: center;
    padding: 1.5rem 0;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.price-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.price-change {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    display: inline-block;
}

.price-change.positive {
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.price-change.negative {
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .section-header h2 {
        font-size: 2rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .metals-grid,
    .features-grid,
    .overview-grid,
    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .price {
        font-size: 2rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .metal-card,
    .feature-card,
    .overview-card,
    .analysis-card {
        padding: 1.5rem;
    }
    
    .price {
        font-size: 1.75rem;
    }
}

