/**
 * UK Product Share Styles
 * Styling for UK Market Outlook > Product Share section charts
 */

/* Chart Container - Simplified Structure */
.uk-product-share .chart-container-full {
    width: 100%;
    max-width: 100%;
    padding: 20px;
    padding-bottom: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: visible;
    position: relative;
    min-height: 600px;
    max-height: 720px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.uk-product-share .chart-container-full canvas {
    width: 100% !important;
    max-width: 100%;
    display: block;
    margin: 16px 0;
    box-sizing: border-box;
    flex-shrink: 0;
    height: 420px !important;
    min-height: 420px;
    max-height: 450px;
}

/* Override any conflicting styles from analysis.css */
.uk-product-share .tab-content-body .chart-container-full {
    overflow: visible !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 600px !important;
    max-height: 720px !important;
}

/* Chart Header */
.uk-product-share .chart-header {
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    flex-shrink: 0;
    display: block !important;
    visibility: visible !important;
}

.uk-product-share .chart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

.uk-product-share .chart-header-row--center {
    justify-content: center;
}

.uk-product-share .chart-header-row--end {
    justify-content: flex-end;
}

/* Chart Footer */
.uk-product-share .chart-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    flex-shrink: 0;
    display: block !important;
    visibility: visible !important;
}

.uk-product-share .time-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    max-width: 100%;
    overflow-x: hidden;
}

.uk-product-share .time-filter-btn {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.uk-product-share .time-filter-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.uk-product-share .time-filter-btn.active {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

/* Loading State */
.uk-product-share .loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 200px;
}

.uk-product-share .loading-spinner {
    margin-bottom: 16px;
}

.uk-product-share .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.uk-product-share .loading-state p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* Error State */
.uk-product-share .error-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 200px;
}

.uk-product-share .error-content {
    text-align: center;
    color: #6b7280;
}

.uk-product-share .error-content .material-icons {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}

.uk-product-share .error-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #111827;
}

.uk-product-share .error-content p {
    font-size: 14px;
    margin: 0;
    color: #6b7280;
}

/* Legend Styles */
.uk-product-share .projection-legend {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: nowrap;
    justify-content: flex-end;
    text-align: right;
    margin-top: 0;
    margin-left: auto;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    font-size: 12px;
    color: #6b7280;
    visibility: visible !important;
    opacity: 1 !important;
}

.uk-product-share #psWindowsProjectionLegend,
.uk-product-share #psInteriorProjectionLegend,
.uk-product-share #psExteriorProjectionLegend {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.uk-product-share .projection-legend span {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.uk-product-share .line-indicator {
    display: inline-block;
    width: 32px;
    height: 0;
    border-bottom: 2px solid #6b7280;
    vertical-align: middle;
}

.uk-product-share .line-indicator.solid {
    border-bottom: 2px solid #10b981;
}

.uk-product-share .line-indicator.dashed {
    border-bottom: 2px dashed #f59e0b;
}

.uk-product-share .line-indicator.dotted {
    border-bottom: 2px dotted #3b82f6;
}

/* Series Legend (Material/Product Type) */
.uk-product-share #psWindowsStatusLegend,
.uk-product-share #psInteriorStatusLegend,
.uk-product-share #psExteriorStatusLegend {
    display: flex !important;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 0;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
}

.uk-product-share .series-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    padding: 4px 8px;
    background: #f9fafb;
    border-radius: 6px;
}

.uk-product-share .series-legend-item .legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Product Share Tabs */
.uk-product-share .product-tabs-wrapper,
.uk-product-share .product-share-tabs {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 2rem auto;
    overflow: visible;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.uk-product-share .product-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 0;
    padding-bottom: 0;
}

.uk-product-share .product-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px 12px 0 0;
    background: transparent;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: -2px;
    min-width: 150px;
    flex: 1;
    transition: all 0.2s ease;
}

.uk-product-share .product-tab-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.uk-product-share .product-tab-btn.active {
    background-color: #374151;
    color: #ffffff;
    border-bottom: 2px solid #374151;
}

.uk-product-share .product-tab-btn .material-icons {
    font-size: 1.25rem;
}

.uk-product-share .product-tab-content {
    background: #ffffff;
    border-radius: 0 12px 12px 12px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: -2px;
    width: 100%;
    max-width: 1600px;
    min-height: 600px;
}

.uk-product-share .product-tab-panel {
    display: none;
    padding: 2rem 3rem;
    overflow: hidden;
}

.uk-product-share .product-tab-panel.active {
    display: block;
}

.uk-product-share .tab-content-body {
    padding: 0;
    overflow: visible;
}

/* Chart Data Table */
.uk-product-share .chart-data-table {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: block !important;
    visibility: visible !important;
}

.uk-product-share .chart-data-table-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    display: block !important;
    visibility: visible !important;
}

/* Responsive */
@media (max-width: 768px) {
    .uk-product-share .chart-container-full {
        padding: 12px;
        padding-bottom: 20px;
        min-height: 520px;
        max-height: 560px;
    }
    
    .uk-product-share .chart-container-full canvas {
        height: 360px !important;
        min-height: 360px;
    }
    
    .uk-product-share .time-filter-buttons {
        gap: 6px;
    }
    
    .uk-product-share .time-filter-btn {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .uk-product-share .product-tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .uk-product-share .product-tab-btn {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
}

