/* Custom Styles with Bootstrap */
body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 
                 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1400px;
    transition: all 0.3s ease;
}

.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    transition: all 0.3s ease;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

/* Chart Section */
.chart-section {
    padding: 20px 0;
}

/* Price Info Box */
.price-info-box {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.price-title {
    font-size: 20px;
    font-weight: 700;
    color: #131722;
    margin-bottom: 8px;
}

.update-time {
    font-size: 13px;
    color: #787b86;
    margin-bottom: 15px;
}

.price-display-large {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.current-price {
    font-size: 36px;
    font-weight: 700;
    color: #131722;
}

.currency-label {
    font-size: 16px;
    color: #787b86;
    font-weight: 500;
}

.price-change {
    font-size: 20px;
    font-weight: 600;
}

.price-change.negative {
    color: #f23645;
}

.price-change.positive {
    color: #089981;
}

.price-percent {
    font-size: 16px;
    font-weight: 600;
}

.price-percent.negative {
    color: #f23645;
}

.price-percent.positive {
    color: #089981;
}

.price-details {
    font-size: 14px;
    line-height: 1.8;
    color: #131722;
}

.price-details p {
    margin-bottom: 10px;
}

.price-details strong {
    font-weight: 600;
    color: #131722;
}

.trend-text {
    color: #f23645;
    font-weight: 500;
}

.trend-value {
    color: #f23645;
    font-weight: 500;
}

.vnd-conversion {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #2962FF;
    margin-top: 10px;
}

.chart-section {
    padding: 0;
}

.chart-section .card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

/* Card Header */
.card-header {
    padding: 1.5rem;
}

.box-headline {
    font-size: 26px;
    font-weight: 700;
    color: #131722;
    margin-bottom: 1rem;
}

.box-headline i {
    margin-right: 10px;
}

.card-header p {
    font-size: 14px;
}

.card-header a {
    color: #2962FF;
    font-weight: 500;
}

.card-header a:hover {
    color: #1E53E5;
}

/* Phong To Button */
#phong_to {
    background: #2962FF;
    border: none;
    color: #ffffff;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#phong_to:hover {
    background: #1E53E5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.3);
}

#phong_to i {
    margin-right: 5px;
}

/* Chart Container */
#gia_vang_the_gioi.bn-bg {
    background: #ffffff;
    min-height: 800px;
    position: relative;
}

.tradingview-widget-container {
    height: 800px;
    width: 100%;
    position: relative;
}

.tradingview-widget-container iframe {
    border: 0;
}

/* Responsive */
@media (max-width: 1400px) {
    .tradingview-widget-container {
        height: 700px;
    }
    
    #gia_vang_the_gioi.bn-bg {
        min-height: 700px;
    }
}

@media (max-width: 992px) {
    body {
        padding: 10px 0;
    }
    
    .chart-section {
        padding: 10px 0;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .box-headline {
        font-size: 22px;
    }
    
    .tradingview-widget-container {
        height: 600px;
    }
    
    #gia_vang_the_gioi.bn-bg {
        min-height: 600px;
    }
}

@media (max-width: 768px) {
    .box-headline {
        font-size: 20px;
    }
    
    .card-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    #phong_to {
        width: 100%;
        text-align: center;
    }
    
    .tradingview-widget-container {
        height: 500px;
    }
    
    #gia_vang_the_gioi.bn-bg {
        min-height: 500px;
    }
}

@media (max-width: 576px) {
    body {
        padding: 5px 0;
    }
    
    .container-fluid {
        padding: 0 5px;
    }
    
    .box-headline {
        font-size: 18px;
    }
    
    .card-header p {
        font-size: 13px;
    }
    
    .tradingview-widget-container {
        height: 400px;
    }
    
    #gia_vang_the_gioi.bn-bg {
        min-height: 400px;
    }
}

/* Animation */
.card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-info {
    font-size: 1rem;
}

/* Main Content */
main {
    padding: 2rem 0;
}

/* Current Price Section */
.current-price-section {
    margin-bottom: 2rem;
}

.price-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.price-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.price-header i {
    font-size: 1.5rem;
}

.price-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.exchange {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-left: auto;
}

.price-display {
    margin-bottom: 1.5rem;
}

.main-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.price-value {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.currency {
    font-size: 1.5rem;
    opacity: 0.9;
}

.price-change {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.change-value {
    font-weight: 600;
}

.change-percent {
    opacity: 0.9;
}

.market-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.8rem 1.2rem;
    background: rgba(34, 171, 148, 0.2);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.status-dot {
    color: var(--positive-color);
    font-size: 0.6rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.price-info {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.info-row .label {
    opacity: 0.8;
}

.info-row .value {
    font-weight: 600;
}

/* Chart Section */
.chart-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-section h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.chart-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.chart-subtitle a {
    color: #2962ff;
    text-decoration: none;
}

.chart-subtitle a:hover {
    text-decoration: underline;
}

.tradingview-widget-container {
    height: 600px;
    position: relative;
}

.tradingview-widget-container__widget {
    height: 100%;
}

.tradingview-widget-copyright {
    font-size: 13px !important;
    line-height: 32px !important;
    text-align: center !important;
    vertical-align: middle !important;
    font-family: 'Trebuchet MS', Arial, sans-serif !important;
    color: #9db2bd !important;
    padding: 10px 0;
}

.tradingview-widget-copyright .blue-text {
    color: #2962ff !important;
}

.tradingview-widget-copyright a {
    text-decoration: none !important;
    color: #2962ff !important;
}

.tradingview-widget-copyright a:hover {
    text-decoration: underline !important;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-grid .info-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.info-grid .info-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.info-grid .info-card h3 {
    color: #333;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.range-info {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.perf-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.perf-label {
    font-size: 0.85rem;
    color: #666;
}

.perf-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.perf-item.positive .perf-value {
    color: var(--positive-color);
}

.perf-item.negative .perf-value {
    color: var(--negative-color);
}

/* Price Section */
.price-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.price-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.update-time {
    color: #666;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.price-table-wrapper {
    overflow-x: auto;
}

.price-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.price-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.price-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.price-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.price-table tbody tr:hover {
    background-color: #f9fafb;
    transition: background-color 0.3s;
}

.gold-type {
    font-weight: 600;
    color: var(--primary-color);
}

.buy-price {
    color: #059669;
    font-weight: 500;
}

.sell-price {
    color: #dc2626;
    font-weight: 500;
}

.change.positive {
    color: var(--positive-color);
    font-weight: 600;
}

.change.negative {
    color: var(--negative-color);
    font-weight: 600;
}

.no-data {
    text-align: center;
    padding: 2rem !important;
    color: #999;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 2rem !important;
    color: #666;
    font-size: 1.1rem;
}

.error-message {
    text-align: center;
    padding: 2rem !important;
    color: #ef4444;
    font-weight: 600;
}

.diff-price {
    color: #6b7280;
    font-weight: 500;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Info Section */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.info-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.info-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.info-card p {
    color: #666;
    line-height: 1.8;
}

/* Footer */
footer {
    background: #333;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.admin-link {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.admin-link:hover {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.3rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .price-value {
        font-size: 2.5rem;
    }
    
    .currency {
        font-size: 1.2rem;
    }
    
    .price-change {
        font-size: 1rem;
    }
    
    .tradingview-widget-container {
        height: 500px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .performance-grid {
        grid-template-columns: 1fr;
    }
    
    .price-table th,
    .price-table td {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .info-section {
        grid-template-columns: 1fr;
    }
    
    footer .container {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.price-section,
.chart-section,
.info-card,
.current-price-section {
    animation: fadeIn 0.6s ease-out;
}
