/* Basic Reset & Font */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #0f0f23;
    color: #e8e8e8;
    font-family: "Google Sans", sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1100px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    flex-shrink: 0;
}

h1 {
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
    font-size: 2.2rem;
}

.last-updated {
    font-size: 1.2rem;
    font-weight: 900;
    color: #cfcfcf;
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
}

.gold-thai {
    grid-row: span 2;
}

/* General Card Styling */
.card {
    background-color: #1a1a35;
    padding: 1.3rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #c0c0d0;
    margin: 0;
}

/* Price & Change Styling */
.price {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0.8rem 0;
    letter-spacing: 0.3px;
}

.change {
    font-size: 1.2rem;
    font-weight: 600;
    color: #c0c0d0;
}

/* Colors for percentage changes */
.change.up, .change.up span {
    color: #4caf50;
}

.change.down, .change.down span {
    color: #ff5252;
}

/* Thai Gold change colors - เฉพาะตัวเลขเท่านั้น */
.gold-change-summary span.up {
    color: #4caf50;
}

.gold-change-summary span.down {
    color: #ff5252;
}

/* Thai Gold Card Styling */
.gold-thai-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /*margin-top: 0.8rem;*/
}

.gold-group {
    text-align: center;
    width: 100%;
}

.gold-type-label {
    font-size: 1.4rem;
    color: #e0e0e0;
    margin-bottom: 0.6rem;
    background: rgba(255, 193, 7, 0.1);
    padding: 0.2rem;
    border-radius: 4px;
    display: inline-block;
    width: 100%;
}

.price-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.price-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.03);
    padding: 0.4rem;
    border-radius: 6px;
}

.price-item .mini-label {
    font-size: 1rem;
    color: #cfcfcf;
    margin-bottom: 0.15rem;
}

.gold-value-large {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffc107;
    line-height: 1.1;
    letter-spacing: 0.3px;
}

.gold-change-summary {
    text-align: center;
    margin-top: 0.8rem;
    font-size: 1.2rem;
    font-weight: 300;
    color: #c0c0d0;
    padding-top: 0.8rem;
}

.gold-meta-info-bottom {
    font-size: 1rem;
    color: #cfcfcf;
    text-align: center;
    margin-top: 0.2rem;
    padding-top: 0.2rem;
}

/* PM2.5 Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.5rem;
    background-color: #555;
    color: white;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

#pm25-container {
    /*position: fixed;
    top: 5px;
    right: 5px;
    z-index: 1000;
    font-size: 1.2rem;*/
    padding-top: 1rem;
    border-radius: 10px;
}

/* Tablet Responsive (768px - 980px) */
@media (max-width: 980px) and (min-width: 768px) {
    .container {
        max-width: 100%;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gold-thai {
        grid-row: span 2;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .last-updated {
        font-size: 1rem;
    }
}

/* Mobile Responsive (< 768px) */
@media (max-width: 767px) {
    body {
        padding: 0.5rem;
        min-height: auto;
    }
    
    .container {
        max-width: 100%;
    }
    
    header {
        margin-bottom: 1rem;
    }
    
    h1 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }
    
    .last-updated {
        font-size: 0.9rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .gold-thai {
        grid-row: span 1;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card h2 {
        font-size: 1.3rem;
    }
    
    .price {
        font-size: 1.8rem;
    }
    
    .change {
        font-size: 1rem;
    }
    
    .gold-type-label {
        font-size: 1.2rem;
    }
    
    .gold-value-large {
        font-size: 1.5rem;
    }
    
    .price-item .mini-label {
        font-size: 0.9rem;
    }
    
    .gold-change-summary {
        font-size: 1rem;
    }
    
    .gold-meta-info-bottom {
        font-size: 0.85rem;
    }
}

/* Small Mobile (< 375px) */
@media (max-width: 374px) {
    h1 {
        font-size: 1.6rem;
    }
    
    .last-updated {
        font-size: 0.8rem;
    }
    
    .card h2 {
        font-size: 1.1rem;
    }
    
    .price {
        font-size: 1.5rem;
    }
    
    .gold-value-large {
        font-size: 1.3rem;
    }
}
