/**
 * ST Gold Price Widget - Styles
 */

/* Base Widget Styles */
.st-gold-price-widget {
    position: relative;
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 320px;
    margin: 20px 0;
}

.st-gold-price-widget:hover {
    transform: translateY(-4px);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .st-gold-price-widget {
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    }
    }
}

/* Header */
.st-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.st-widget-label {
    font-size: 14px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.st-widget-unit {
    font-size: 12px;
    font-weight: 500;
    color: #999;
}

@media (prefers-color-scheme: dark) {
    .st-widget-label {
        color: #aaa;
    }
    .st-widget-unit {
        color: #777;
    }
}

/* Price Display */
.st-widget-price {
    display: flex;
    align-items: baseline;
    margin-bottom: 12px;
}

.st-currency-symbol {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-right: 4px;
}

.st-price-value {
    font-size: 42px;
    font-weight: 800;
    color: #000;
    line-height: 1;
    letter-spacing: -1px;
}

@media (prefers-color-scheme: dark) {
    .st-currency-symbol {
        color: #ddd;
    }
    .st-price-value {
        color: #fff;
    }
}

/* Change Indicator */
.st-widget-change {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    width: fit-content;
}

.st-widget-change.positive {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.st-widget-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.st-change-icon {
    font-size: 18px;
}

.st-change-percent {
    font-weight: 700;
}

.st-change-amount {
    font-weight: 500;
    opacity: 0.8;
}

/* Footer */
.st-widget-footer {
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    .st-widget-footer {
        border-top-color: rgba(255, 255, 255, 0.08);
    }
}

.st-update-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #999;
    font-weight: 500;
}

.st-update-time svg {
    opacity: 0.6;
}

/* Sparkle Effect */
.st-widget-sparkle {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.st-gold-price-widget:hover .st-widget-sparkle {
    opacity: 1;
}

/* Animation */
@keyframes st-widget-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.st-gold-price-widget.st-animate {
    animation: st-widget-fade-in 0.6s ease-out;
}

/* Style Variants */

/* Modern Style (Default) */
.st-style-modern {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Minimal Style */
.st-style-minimal {
    background: #ffffff;
    border: 2px solid #e5e7eb;
}

.st-style-minimal:hover {
    border-color: var(--st-primary-color, #2888bf);
}

/* Elegant Style */
.st-style-elegant {
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    border-left: 4px solid var(--st-primary-color, #2888bf);
    padding-left: 28px;
}

/* Bold Style */
.st-style-bold {
    background: linear-gradient(135deg, var(--st-primary-color, #2888bf) 0%, var(--st-secondary-color, #1a6da0) 100%);
    color: #ffffff;
}

.st-style-bold .st-widget-label,
.st-style-bold .st-widget-unit,
.st-style-bold .st-currency-symbol,
.st-style-bold .st-price-value,
.st-style-bold .st-update-time {
    color: #ffffff;
}

.st-style-bold .st-widget-change.positive {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.st-style-bold .st-widget-change.negative {
    background: rgba(255, 255, 255, 0.15);
    color: #ffdddd;
}

.st-style-bold .st-widget-footer {
    border-top-color: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 480px) {
    .st-gold-price-widget {
        max-width: 100%;
        padding: 20px;
    }
    
    .st-price-value {
        font-size: 36px;
    }
    
    .st-currency-symbol {
        font-size: 24px;
    }
}

/* Error State */
.st-gold-price-widget.error {
    background: #fee;
    border: 2px solid #fcc;
    color: #c00;
    padding: 16px;
    font-weight: 500;
}
