/**
 * Star Energy Share Price Plugin Styles
 */

/* Main Share Price Container */
.star-share-price {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: inline-block;
    background: #fff;
    border-radius: 4px;
    padding: 8px 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

/* Header Ticker Style */
.star-share-price-header {
    background: #17203a;
    color: #fff;
    padding: 8px 16px;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.star-share-price-header .share-price-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.star-share-price-header .market {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 10px;
}

.star-share-price-header .symbol {
    font-weight: 700;
}

/* Main Price Display */
.share-price-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.star-share-price-header .share-price-main {
    color: #fff;
}

.price {
    font-size: 16px;
    font-weight: 700;
    color: #17203a;
}

.star-share-price-header .price {
    color: #fff;
    font-size: 14px;
}

/* Change Indicators */
.change-indicator {
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
}

.change-indicator svg {
    width: 8px;
    height: 12px;
}

.change-indicator.positive svg {
    fill: #4dd460;
}

.change-indicator.negative svg {
    fill: #d44d4d;
}

.change-decimal {
    font-size: 14px;
    font-weight: 600;
    margin-right: 4px;
}

.change-percentage {
    font-size: 12px;
    opacity: 0.8;
}

/* Positive/Negative Colors */
.star-share-price .positive {
    color: #4dd460;
}

.star-share-price .negative {
    color: #d44d4d;
}

.star-share-price-header .positive {
    color: #4dd460;
}

.star-share-price-header .negative {
    color: #d44d4d;
}

/* Date Display */
.share-price-date {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    text-align: right;
}

.star-share-price-header .share-price-date {
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
}

/* Format Variations */
.star-share-price-simple {
    padding: 6px 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.star-share-price-simple .price {
    font-size: 18px;
    margin-right: 8px;
}

.star-share-price-simple .change {
    font-size: 14px;
    font-weight: 600;
}

.star-share-price-price-only {
    padding: 4px 8px;
    background: #17203a;
    color: #fff;
    border: none;
}

.star-share-price-price-only .price {
    color: #fff;
    font-size: 16px;
}

/* Hero Style */
.star-share-price-hero {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e1e5e9;
    max-width: 400px;
}

.star-share-price-hero .share-price-header {
    margin-bottom: 8px;
}

.star-share-price-hero .share-price-main {
    margin-bottom: 8px;
}

.star-share-price-hero .price {
    font-size: 24px;
    margin-right: 12px;
}

.star-share-price-hero .change-indicator svg {
    width: 13px;
    height: 14px;
}

.star-share-price-hero .change-decimal {
    font-size: 16px;
}

.star-share-price-hero .change-percentage {
    font-size: 14px;
}

/* Widget Style */
.star-share-price-widget {
    background: #fff;
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.star-share-price-widget .price {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.star-share-price-widget .change {
    font-size: 14px;
    display: block;
}

/* Error State */
.star-share-price-error {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .star-share-price {
        padding: 6px 10px;
    }
    
    .star-share-price .price {
        font-size: 14px;
    }
    
    .star-share-price-hero .price {
        font-size: 20px;
    }
    
    .star-share-price-hero {
        padding: 12px 16px;
    }
    
    .share-price-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .star-share-price-hero .share-price-main {
        flex-direction: row;
        align-items: center;
    }
}

/* Animation for price updates */
.star-share-price-updating {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.star-share-price-updated {
    animation: priceUpdate 0.5s ease-in-out;
}

@keyframes priceUpdate {
    0% { background-color: #fff; }
    50% { background-color: #e8f5e8; }
    100% { background-color: #fff; }
}

/* Loading state */
.star-share-price-loading {
    position: relative;
}

.star-share-price-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.star-share-price-loading::before {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #666;
    z-index: 1;
}

/* Accessibility */
.star-share-price:focus-within {
    outline: 2px solid #4dd460;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .star-share-price {
        border: 2px solid #000;
    }
    
    .star-share-price-header {
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .star-share-price-updated {
        animation: none;
    }
    
    .star-share-price-updating {
        transition: none;
    }
}

