/* La Gaceta Live Data Widget Styles */

.lg-live-data-widget {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.lg-live-data-widget.minimized .lg-live-panel {
    display: none;
}

.lg-live-data-widget.minimized .lg-live-toggle {
    border-radius: 8px 8px 0 0;
}

/* Toggle Bar - Always Visible */
.lg-live-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 8px 16px;
    cursor: pointer;
    border-top: 2px solid #e94560;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    user-select: none;
    gap: 16px;
}

.lg-live-toggle:hover {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
}

.lg-live-toggle:focus {
    outline: 2px solid #e94560;
    outline-offset: -2px;
}

.lg-toggle-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.lg-toggle-icon {
    font-size: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.lg-toggle-title {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.lg-toggle-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    opacity: 0.9;
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 12px;
}

.lg-toggle-location svg {
    width: 14px;
    height: 14px;
}

.lg-toggle-indicators {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Quick indicators in toggle bar */
.lg-quick-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    font-size: 12px;
    min-width: 0;
}

.lg-quick-indicator .label {
    opacity: 0.7;
    white-space: nowrap;
}

.lg-quick-indicator .value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lg-quick-indicator.positive .value { color: #4ade80; }
.lg-quick-indicator.negative .value { color: #f87171; }
.lg-quick-indicator.neutral .value { color: #fbbf24; }

.lg-toggle-expand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lg-toggle-expand:hover { opacity: 1; }

.lg-toggle-expand svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s;
}

.lg-live-data-widget.minimized .lg-toggle-expand svg {
    transform: rotate(180deg);
}

/* Main Panel */
.lg-live-panel {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
    max-height: 70vh;
    overflow-y: auto;
}

/* Section Styling */
.lg-live-section {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.lg-live-section:last-child {
    border-bottom: none;
}

.lg-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.lg-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #374151;
}

.lg-section-title svg {
    width: 18px;
    height: 18px;
    color: #e94560;
}

.lg-section-meta {
    font-size: 11px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 12px;
}

.lg-section-meta .source {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* Weather Section */
.lg-weather-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
}

.lg-weather-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lg-weather-temp {
    font-size: 48px;
    font-weight: 300;
    color: #111827;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.lg-weather-condition {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.lg-weather-icon {
    font-size: 28px;
}

.lg-weather-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}

.lg-weather-detail {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f9fafb;
    padding: 4px 10px;
    border-radius: 8px;
}

.lg-weather-forecast {
    display: flex;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.lg-forecast-day {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: #f9fafb;
    border-radius: 8px;
}

.lg-forecast-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
}

.lg-forecast-temps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.lg-forecast-high {
    font-weight: 600;
    color: #111827;
}

.lg-forecast-low {
    color: #9ca3af;
}

.lg-forecast-icon {
    font-size: 20px;
    margin: 4px 0;
}

.lg-forecast-rain {
    font-size: 10px;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

/* Stocks / Market Section */
.lg-market-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.lg-market-status.open {
    background: #dcfce7;
    color: #166534;
}

.lg-market-status.closed {
    background: #fee2e2;
    color: #991b1b;
}

.lg-market-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: blink 1.5s infinite;
}

.lg-market-status.closed .dot {
    animation: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.lg-index-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.lg-index-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.lg-index-name {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.lg-index-value {
    font-size: 32px;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.lg-index-change {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 8px;
}

.lg-index-change .change {
    font-size: 14px;
    font-weight: 500;
}

.lg-index-change .pct {
    font-size: 13px;
    opacity: 0.9;
}

.lg-index-change.positive .change,
.lg-index-change.positive .pct { color: #4ade80; }
.lg-index-change.negative .change,
.lg-index-change.negative .pct { color: #f87171; }

.lg-stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.lg-stock-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s;
}

.lg-stock-card:hover {
    border-color: #e94560;
    box-shadow: 0 2px 8px rgba(233,69,96,0.1);
    transform: translateY(-1px);
}

.lg-stock-name {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.lg-stock-price {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.lg-stock-change {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e5e7eb;
    font-size: 11px;
}

.lg-stock-change .change {
    font-weight: 600;
}

.lg-stock-change .pct {
    opacity: 0.8;
}

.lg-stock-change.positive .change,
.lg-stock-change.positive .pct { color: #16a34a; }
.lg-stock-change.negative .change,
.lg-stock-change.negative .pct { color: #dc2626; }
.lg-stock-change.delayed {
    font-size: 10px;
    color: #9ca3af;
}

/* Indicators Section */
.lg-indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.lg-indicator-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.lg-indicator-card:hover {
    border-color: #e94560;
    box-shadow: 0 4px 12px rgba(233,69,96,0.08);
}

.lg-indicator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e94560, #fbbf24);
}

.lg-indicator-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #9ca3af;
    margin-bottom: 6px;
}

.lg-indicator-value {
    font-size: 18px;
    font-weight: 500;
    color: #111827;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.lg-indicator-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    font-size: 10px;
    color: #9ca3af;
}

.lg-indicator-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

.lg-indicator-trend.up {
    background: #dcfce7;
    color: #166534;
}

.lg-indicator-trend.down {
    background: #fee2e2;
    color: #991b1b;
}

.lg-indicator-trend.stable {
    background: #fef3c7;
    color: #92400e;
}

.lg-indicator-trend svg {
    width: 10px;
    height: 10px;
}

/* News Ticker */
.lg-news-ticker {
    background: #1a1a2e;
    color: #fff;
    padding: 10px 16px;
    position: relative;
    overflow: hidden;
}

.lg-ticker-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.lg-ticker-label {
    background: #e94560;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: blink 1.5s infinite;
}

.lg-ticker-track {
    display: flex;
    gap: 32px;
    animation: ticker-scroll 30s linear infinite;
    width: max-content;
}

.lg-ticker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 280px;
}

.lg-ticker-item a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.lg-ticker-item a:hover {
    color: #fbbf24;
}

.lg-ticker-category {
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.lg-ticker-time {
    font-size: 11px;
    opacity: 0.7;
    color: #fbbf24;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.lg-ticker-track:hover {
    animation-play-state: paused;
}

/* Loading States */
.lg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #9ca3af;
    font-size: 13px;
}

.lg-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lg-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lg-live-toggle {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }
    
    .lg-toggle-indicators {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .lg-quick-indicator {
        flex: 1;
        justify-content: center;
    }
    
    .lg-weather-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .lg-weather-temp {
        font-size: 40px;
    }
    
    .lg-stocks-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .lg-indicators-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .lg-index-value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .lg-stocks-grid,
    .lg-indicators-grid {
        grid-template-columns: 1fr;
    }
    
    .lg-forecast-day {
        flex: 1;
        min-width: 60px;
    }
}

/* Accessibility */
.lg-live-data-widget * {
    box-sizing: border-box;
}

.lg-live-toggle:focus-visible,
.lg-stock-card:focus-visible,
.lg-indicator-card:focus-visible,
.lg-ticker-item a:focus-visible {
    outline: 2px solid #e94560;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lg-live-data-widget *,
    .lg-live-data-widget *::before,
    .lg-live-data-widget *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .lg-ticker-track {
        animation: none;
    }
}

/* Print styles */
@media print {
    .lg-live-data-widget {
        display: none !important;
    }
}
