/* Charts Page Styles */

.chart-content {
    min-height: 600px;
    position: relative;
}

/* Enhanced Price Header Styles */
.price-header-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(123, 30, 34, 0.1);
    transition: all 0.3s ease;
}

.price-header-wrapper:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.price-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    background: linear-gradient(
        135deg,
        rgba(123, 30, 34, 0.03) 0%,
        rgba(184, 134, 11, 0.03) 100%
    );
    border-bottom: 1px solid rgba(123, 30, 34, 0.08);
    flex-wrap: wrap;
    gap: 20px;
}

.price-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.metal-icon-wrapper {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.metal-icon-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.metal-icon-img {
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
}

.metal-symbol {
    font-size: 2rem;
    font-weight: 700;
}

.metal-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metal-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c2c2c;
    margin: 0;
    letter-spacing: -0.5px;
}

.metal-description {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

.price-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.current-price-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-dot {
    width: 10px;
    height: 10px;
    background-color: #28a745;
    border-radius: 50%;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(40, 167, 69, 0);
    }
}

.current-price {
    font-size: 2.25rem;
    font-weight: 800;
    color: #7b1e22;
    margin: 0;
    letter-spacing: -1px;
    transition: all 0.3s ease;
}

.price-change-wrapper .badge {
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.price-change-wrapper .badge.bg-success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.price-change-wrapper .badge.bg-danger {
    background: linear-gradient(135deg, #dc3545, #e74c3c) !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Price Stats Row */
.price-stats-row {
    display: flex;
    justify-content: space-around;
    padding: 20px 28px;
    background-color: #ffffff;
    gap: 16px;
    flex-wrap: wrap;
}

.price-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    flex: 1;
    min-width: 150px;
    transition: all 0.3s ease;
}

.price-stat-item:hover {
    background: #f0f4f8;
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.1rem;
}

.stat-icon.high {
    background: linear-gradient(
        135deg,
        rgba(40, 167, 69, 0.15),
        rgba(40, 167, 69, 0.05)
    );
    color: #28a745;
}

.stat-icon.low {
    background: linear-gradient(
        135deg,
        rgba(220, 53, 69, 0.15),
        rgba(220, 53, 69, 0.05)
    );
    color: #dc3545;
}

.stat-icon.update {
    background: linear-gradient(
        135deg,
        rgba(123, 30, 34, 0.15),
        rgba(123, 30, 34, 0.05)
    );
    color: #7b1e22;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c2c2c;
}

.stat-value.high {
    color: #28a745;
}

.stat-value.low {
    color: #dc3545;
}

/* Legacy support */
#current-price {
    font-size: 2.25rem;
    transition: color 0.3s ease;
}

#price-change .badge {
    font-size: 0.95rem;
    padding: 8px 14px;
    transition: all 0.3s ease;
}

#price-change .badge.bg-success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
}

#price-change .badge.bg-danger {
    background: linear-gradient(135deg, #dc3545, #e74c3c) !important;
}

.chart-wrapper {
    position: relative;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 0;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Filter Sidebar Animations */
.filter-dropdown-btn {
    transition: all 0.3s ease;
}

.filter-dropdown-btn:hover {
    background-color: #f8f9fa;
    border-color: #7b1e22;
}

.filter-dropdown-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.filter-dropdown-btn i {
    transition: transform 0.3s ease;
}

/* Radio button custom styling */
.form-check-input:checked {
    background-color: #7b1e22;
    border-color: #7b1e22;
}

.form-check-input:focus {
    border-color: #7b1e22;
    box-shadow: 0 0 0 0.25rem rgba(123, 30, 34, 0.25);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Price change animations */
@keyframes priceUp {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(40, 167, 69, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

@keyframes priceDown {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(220, 53, 69, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

.price-up {
    animation: priceUp 1s ease;
}

.price-down {
    animation: priceDown 1s ease;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .price-header-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .price-header-left {
        flex-direction: column;
        text-align: center;
    }

    .price-header-right {
        align-items: center;
    }

    .price-stats-row {
        padding: 16px;
    }

    .price-stat-item {
        min-width: calc(50% - 12px);
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .price-header-wrapper {
        border-radius: 8px;
    }

    .metal-icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .metal-icon-img {
        max-width: 40px;
        max-height: 40px;
    }

    .metal-name {
        font-size: 1.4rem;
    }

    .current-price {
        font-size: 1.8rem;
    }

    #current-price {
        font-size: 1.8rem;
    }

    .price-stat-item {
        min-width: 100%;
    }

    .chart-wrapper {
        height: 300px !important;
        padding: 10px;
    }

    .filter-sidebar {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .price-header-main {
        padding: 16px;
    }

    .metal-name {
        font-size: 1.2rem;
    }

    .metal-description {
        font-size: 0.85rem;
    }

    .current-price {
        font-size: 1.5rem;
    }

    #current-price {
        font-size: 1.5rem;
    }

    .price-change-wrapper .badge {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .stat-value {
        font-size: 1rem;
    }
}

/* Chart tooltip custom styling */
.chartjs-tooltip {
    opacity: 1;
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 3px;
    padding: 10px;
    pointer-events: none;
    transform: translate(-50%, -100%);
    transition: all 0.1s ease;
}

.chartjs-tooltip-key {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 10px;
}

/* Additional info section */
.alert-info {
    border-left: 4px solid #0dcaf0;
    background-color: #f0f9ff;
    border-color: #b6e3f5;
}

/* Period badges for live updates */
.live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
    margin-right: 0.5rem;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Metal-specific icon colors */
.metal-icon.gold {
    color: #b8860b;
}

.metal-icon.silver {
    color: #c0c0c0;
}

.metal-icon.platinum {
    color: #e5e4e2;
}

.metal-icon.palladium {
    color: #ccc5b9;
}

.metal-icon.bitcoin {
    color: #f7931a;
}

/* Chart container */
#priceChart {
    max-height: 100%;
    width: 100% !important;
}

/* Custom Loader Animation */
.custom-loader {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-circle {
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
    border-top-color: #7b1e22;
    animation: spin 1.5s linear infinite;
}

.loader-circle:nth-child(1) {
    width: 100%;
    height: 100%;
    border-top-color: #7b1e22;
    animation: spin 2s linear infinite;
}

.loader-circle:nth-child(2) {
    width: 70%;
    height: 70%;
    border-top-color: #b8860b;
    animation: spin 1.5s linear infinite reverse;
}

.loader-circle:nth-child(3) {
    width: 40%;
    height: 40%;
    border-top-color: #333;
    animation: spin 1s linear infinite;
}

.loader-text {
    position: absolute;
    bottom: -30px;
    width: 150px;
    text-align: center;
    font-weight: bold;
    color: #7b1e22;
    font-size: 0.9rem;
    letter-spacing: 1px;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
