/* home.css - Home page specific styles */

/* Date Display */
.date-display {
    background: var(--silver-light);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
    font-weight: 600;
    color: var(--silver-dark);
    border: 1px solid #e8e8e8;
    font-size: 14px;
}

/* Enhanced Hero Section with Dual Price Focus */
.hero {
    background: linear-gradient(135deg, var(--silver-light) 0%, #e8e8e8 100%);
    padding: 25px 0;
    margin: 15px 0;
    border-radius: 10px;
    text-align: center;
    position: relative;
}

.immediate-price-display {
    text-align: center;
    margin-bottom: 15px;
}

.live-price-badge {
    display: inline-flex;
    align-items: center;
    background: #ff4444;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    margin-right: 6px;
    animation: blink 1.5s infinite;
}

.dual-price-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.price-block {
    text-align: center;
    min-width: 200px;
}

.price-label {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 600;
}

.hero-price {
    font-size: 32px;
    font-weight: 700;
    display: block;
    margin: 5px 0;
}

.hero-price.silver {
    color: var(--silver-dark);
}

.hero-price.gold {
    color: var(--gold);
}

.price-unit {
    color: var(--text-light);
    font-size: 14px;
}

.hero h1 {
    color: var(--silver-dark);
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

.hero p {
    color: var(--text-light);
    max-width: 100%;
    margin: 0 auto 15px;
    font-size: 16px;
    padding: 0 10px;
}

/* Price Cards - Mobile First */
.price-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 25px 0;
}

.card {
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.silver .card-header {
    background-color: var(--silver-light);
}

.gold .card-header {
    background-color: var(--gold-light);
}

.metal-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.silver .metal-icon {
    background-color: var(--silver);
    color: #696969;
}

.gold .metal-icon {
    background-color: #ffd700;
    color: #b8860b;
}

.card-header h2 {
    font-size: 18px;
    margin: 0;
}

.card-body {
    padding: 15px;
}

.price {
    font-size: 28px;
    font-weight: 700;
    margin: 10px 0;
}

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

.gold .price {
    color: var(--gold);
}

.change {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
    margin-bottom: 12px;
    font-size: 14px;
}

.positive {
    background-color: #e6f7ee;
    color: var(--positive);
}

.negative {
    background-color: #ffe6e6;
    color: var(--negative);
}

.purity-badge {
    margin: 10px 0;
}

.hallmark-badge {
    background: linear-gradient(135deg, var(--silver), var(--silver-dark));
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(192, 192, 192, 0.3);
}

.gold-badge {
    background: linear-gradient(135deg, #FFD700, #D4AF37);
}

.unit {
    color: var(--text-light);
    font-size: 14px;
    margin: 5px 0;
}

.last-updated {
    color: #888;
    font-size: 13px;
}

/* Main Content Layout - Mobile First */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin: 25px 0;
}

.content-area {
    width: 100%;
}

.sidebar {
    width: 100%;
    display: none; /* Hidden on mobile by default */
}

/* Charts Section */
.charts-section {
    margin: 30px 0;
}

.section-title {
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

.chart-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.chart-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
}

.time-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.time-filter {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    min-width: 70px;
    max-width: 100px;
    color: var(--text);
    font-weight: 500;
}

.time-filter.active {
    background-color: var(--silver-dark);
    color: white;
    border-color: var(--silver-dark);
}

.time-filter:hover {
    background-color: var(--silver-light);
}

.chart-wrapper {
    position: relative;
    height: 250px;
}

/* Enhanced Price Table for Both Metals */
.price-table-section {
    margin: 30px 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 600px;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    background-color: #f8f8f8;
    font-weight: 600;
}

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

.silver-row {
    background-color: rgba(192, 192, 192, 0.05);
}

.gold-row {
    background-color: rgba(212, 175, 55, 0.05);
}

/* Calculator */
.calculator {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin: 30px 0;
}

.calculator h2 {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 20px;
}

.calc-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 15px;
}

button {
    background-color: var(--silver);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    width: 100%;
}

button:hover {
    background-color: var(--silver-dark);
}

.result {
    margin-top: 15px;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 5px;
    display: none;
}

.result.active {
    display: block;
}

/* News Section */
.news-section {
    margin: 30px 0;
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.news-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.news-img {
    height: 160px;
    background-color: #eee;
    background-size: cover;
    background-position: center;
}

.news-content {
    padding: 15px;
}

.news-title {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text);
    line-height: 1.4;
}

.news-date {
    color: #888;
    font-size: 13px;
    margin-bottom: 8px;
}

.news-excerpt {
    color: var(--text-light);
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.read-more {
    color: var(--silver-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

/* Tablet Styles for Home */
@media (min-width: 768px) {
    .hero h1 {
        font-size: 28px;
    }
    
    .price-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .main-content {
        flex-direction: row;
    }
    
    .content-area {
        width: 70%;
    }
    
    .sidebar {
        width: 30%;
        display: block;
    }
    
    .calc-form {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .time-filters {
        justify-content: flex-end;
        flex-wrap: nowrap;
    }
    
    .time-filter {
        flex: none;
    }
}

/* Desktop Styles for Home */
@media (min-width: 1024px) {
    .hero h1 {
        font-size: 32px;
    }
    
    .hero-price {
        font-size: 36px;
    }
    
    .price {
        font-size: 32px;
    }
    
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .calc-form {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .chart-wrapper {
        height: 300px;
    }
    
    .calculator {
        padding: 25px;
    }
}

/* Mobile Adjustments for Home */
@media (max-width: 767px) {
    .hero {
        padding: 20px 0;
    }
    
    .hero h1 {
        font-size: 22px;
    }
    
    .hero-price {
        font-size: 28px;
    }
    
    .dual-price-display {
        gap: 15px;
    }
    
    .price-block {
        min-width: 150px;
    }
}