/* THG Market Analytics Dashboard Styles - Updated to Match Individual Card Pages */

/* Analytics Card Links - Enhanced */
.analytics-card-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.analytics-card-link:hover {
    color: #1d4ed8;
    text-decoration: none;
    border-bottom-color: #2563eb;
}

/* Override link styles in different sections */
.top-sale-item .analytics-card-link,
.traded-card-item .analytics-card-link {
    color: #1f2937;
    font-weight: 600;
}

.top-sale-item .analytics-card-link:hover,
.traded-card-item .analytics-card-link:hover {
    color: #2563eb;
}

.gem-item .analytics-card-link {
    color: #1f2937;
    font-weight: 600;
    font-size: 0.95em;
}

.recent-sale-item .analytics-card-link {
    color: #1f2937;
    font-weight: 600;
    font-size: 1.1em;
}

.thg-analytics-container {
    background: #fff;
    border-radius: 0;
    padding: 0;
    margin: 20px 0;
    box-shadow: none;
    overflow: visible;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
}

/* SEO Hero Section - Matches Recent Sales & Top 50 Cards Style */
.thg-seo-hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(26, 180, 158, 0.05) 0%, rgba(31, 41, 55, 0.02) 100%);
    border-radius: 12px;
    border: 1px solid rgba(26, 180, 158, 0.1);
}

.thg-seo-title {
    font-size: 36px;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 20px 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #1AB49E 0%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.thg-seo-description {
    font-size: 18px;
    line-height: 1.6;
    color: #4b5563;
    max-width: 900px;
    margin: 0 auto;
    font-weight: 400;
}

.thg-seo-description strong {
    color: #1AB49E;
    font-weight: 600;
}

/* Hero Header - Match Individual Card Page Style */
.thg-analytics-hero {
    background: linear-gradient(135deg, #111827 0%, #374151 50%, #6b7280 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Hero Statistics Bar */
.thg-hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stat-item {
    padding: 20px 16px;
    text-align: center;
    color: white;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.hero-stat-item:last-child {
    border-right: none;
}

.hero-stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-change {
    font-size: 0.75em;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-change.positive {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.stat-change.neutral {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

/* Analytics Filters - Match Individual Card Page Filter Design */
.thg-analytics-filters {
    background: linear-gradient(135deg, #111827 0%, #374151 50%, #6b7280 100%);
    color: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Enhanced Chart Container for Analytics Filters - Match Individual Card Page */
.thg-enhanced-chart-container[data-chart-type="analytics-filters"] {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-chart-header {
    background: #f8fafc;
    color: #374151;
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-chart-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #374151 !important;
    text-shadow: none;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-filters-content {
    background: white;
    padding: 20px;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-filter-item label {
    color: #374151;
    font-weight: 500;
    font-size: 13px;
    margin: 0;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-enhanced-filter {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 14px;
    transition: all 0.2s ease;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-enhanced-filter:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-filters-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    margin-bottom: 16px;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-apply-filters-btn,
.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-reset-filters-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-transform: none;
    letter-spacing: 0.025em;
    white-space: nowrap;
    display: inline-block;
    vertical-align: top;
    line-height: 1.2;
    min-width: 120px;
    text-align: center;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-apply-filters-btn {
    background: #059669;
    color: white;
    border: 1px solid #059669;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-apply-filters-btn:hover {
    background: #047857;
    border-color: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-reset-filters-btn {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .thg-reset-filters-btn:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .filter-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .preset-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: top;
    line-height: 1.3;
    min-width: fit-content;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .preset-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .preset-btn.active {
    background: #1e40af;
    border-color: #1e40af;
    color: white;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
}

/* Custom Date Range Styling for Analytics Filters */
.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .custom-date-inputs {
    grid-column: 1 / -1;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .date-range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .date-range-inputs input[type="date"] {
    flex: 1;
    min-width: 140px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 14px;
    transition: all 0.2s ease;
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .date-range-inputs input[type="date"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.thg-enhanced-chart-container[data-chart-type="analytics-filters"] .date-separator {
    color: #6b7280;
    font-weight: 500;
    font-size: 12px;
    white-space: nowrap;
}

.thg-analytics-filters h3 {
    color: white !important;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.filter-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    margin-right: 6px;
    min-width: 80px;
}

.analytics-filter {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 13px;
    min-width: 140px;
    transition: all 0.2s ease;
}

.analytics-filter:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.analytics-filter option {
    background: #374151;
    color: white;
}

.filter-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.preset-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.preset-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
    font-weight: 600;
}

/* Main Analytics Grid - Match Individual Card Page Layout */
.thg-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    padding: 0;
    background: transparent;
}

/* Analytics Cards - Match Individual Card Page Cards */
.analytics-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    border: 1px solid #e2e8f0;
}

.analytics-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Card Headers - Clean Professional Style */
.analytics-card .card-header {
    background: #f8fafc;
    color: #374151;
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.analytics-card .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #374151 !important;
    text-shadow: none;
}

.analytics-card .card-header p {
    font-size: 13px;
    margin: 0;
    opacity: 0.8;
    color: #64748b;
}

/* Card Content */
.analytics-card .card-content {
    padding: 16px;
}

.analytics-card.full-width {
    grid-column: 1 / -1;
}

/* Chart Container Styling - Clean Professional Style */
.analytics-card .thg-enhanced-chart-container {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: white;
}

.analytics-card .thg-chart-header {
    background: #f8fafc;
    color: #374151;
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.analytics-card .thg-chart-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #374151 !important;
    text-shadow: none;
}

/* List Styling Improvements */
.top-sales-list,
.recent-sales-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-sale-item,
.recent-sale-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.top-sale-item:hover,
.recent-sale-item:hover {
    background: #f1f5f9;
}

/* Sale Details Styling */
.sale-rank {
    font-weight: 700;
    color: #6366f1;
    font-size: 14px;
    min-width: 30px;
}

.sale-details {
    flex: 1;
    margin-left: 12px;
}

.sale-card {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.sale-info,
.sale-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.parallel-type,
.sale-parallel {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.condition,
.sale-condition {
    background: #dcfce7;
    color: #166534;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.sale-price {
    font-weight: 700;
    color: #059669;
    font-size: 16px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .thg-seo-hero {
        padding: 20px 15px;
        margin-bottom: 30px;
    }
    
    .thg-seo-title {
        font-size: 28px;
    }
    
    .thg-seo-description {
        font-size: 16px;
    }
    
    .thg-analytics-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .thg-hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filter-group label {
        min-width: auto;
    }
    
    .analytics-filter {
        width: 100%;
        max-width: 200px;
    }
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.card-header h3 {
    margin: 0 0 5px 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #343a40;
}

.card-header p {
    margin: 0;
    font-size: 0.9em;
    color: #6c757d;
}

.card-content {
    padding: 20px;
}

/* Top Sales List */
.top-sales-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-sale-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.top-sale-item:hover {
    background: #e9ecef;
}

.sale-rank {
    font-size: 1.2em;
    font-weight: 700;
    color: #667eea;
    width: 35px;
    text-align: center;
}

.sale-details {
    flex: 1;
    margin-left: 12px;
}

.sale-card {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 3px;
    font-size: 0.95em;
}

.sale-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.parallel-type,
.condition {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.condition {
    background: #28a745;
}

.sale-price {
    font-size: 1.1em;
    font-weight: 700;
    color: #28a745;
}

/* Parallel Analysis */
.parallel-analysis {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.base-price-ref {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9em;
    color: #1565c0;
}

.parallel-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.parallel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.parallel-name {
    font-weight: 600;
    color: #343a40;
    flex: 1;
}

.parallel-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 10px;
}

.parallel-price {
    font-weight: 700;
    color: #28a745;
    font-size: 1.1em;
}

.parallel-multiplier {
    font-size: 0.8em;
    color: #667eea;
    font-weight: 600;
}

.premium-percent {
    color: #dc3545;
}

.parallel-volume {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: 500;
}

/* Country Origins Analysis */
.country-analysis {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.overall-price-ref {
    padding: 10px;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border-radius: 6px;
    border-left: 4px solid #28a745;
    font-size: 0.9em;
    text-align: center;
}

.country-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.country-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #17a2b8;
}

.country-name {
    font-weight: 600;
    color: #343a40;
    flex: 1;
}

.country-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 10px;
}

.country-price {
    font-weight: 700;
    color: #28a745;
    font-size: 1.1em;
}

.country-multiplier {
    font-size: 0.8em;
    color: #17a2b8;
    font-weight: 600;
}

.country-volume {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: 500;
}

/* Most Traded Cards */
.traded-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.traded-card-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

.card-name {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 6px;
}

.trading-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85em;
}

.sales-count {
    background: #17a2b8;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.price-range {
    color: #6c757d;
    font-weight: 500;
}

.avg-price {
    color: #28a745;
    font-weight: 600;
}

/* Hidden Gems */
.hidden-gems-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gem-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 8px;
    border-left: 4px solid #ff9800;
    gap: 12px;
}

.gem-image {
    flex-shrink: 0;
    width: 60px;
    height: 84px;
    overflow: hidden;
    border-radius: 6px;
    border: 2px solid #ff9800;
    background: white;
}

.gem-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gem-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gem-name {
    font-weight: 600;
    color: #e65100;
    font-size: 0.95em;
    line-height: 1.3;
}

.gem-stats {
    display: flex;
    gap: 12px;
    font-size: 0.85em;
    flex-wrap: wrap;
}

.gem-sales {
    color: #6c757d;
    font-weight: 500;
}

.gem-price {
    color: #ff9800;
    font-weight: 700;
}


/* Most Recent Sales */
.recent-sales-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-sale-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    transition: background-color 0.3s ease;
}

.recent-sale-item:hover {
    background: #e9ecef;
}

.sale-details {
    flex: 1;
    min-width: 0;
}

.sale-card-name {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 6px;
    font-size: 0.95em;
    line-height: 1.3;
}

.sale-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.sale-parallel {
    background: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.sale-condition {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.sale-date {
    color: #6c757d;
    font-size: 0.8em;
    font-weight: 500;
}

.sale-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 120px;
}

.sale-price {
    font-size: 1.1em;
    font-weight: 700;
    color: #28a745;
}

/* eBay Button Styling for Analytics Cards */
.gem-details .thg-ebay-button,
.sale-actions .thg-ebay-button {
    margin-top: 0;
    padding: 0;
    border: 1px solid #28a745;
    background: #fff;
    border-radius: 4px;
    font-size: 0.8em;
    align-self: flex-start;
}

.sale-actions .thg-ebay-button.small {
    font-size: 0.75em;
}

.gem-details .thg-ebay-button a,
.sale-actions .thg-ebay-button a {
    display: inline-block;
    padding: 6px 12px;
    color: #28a745;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sale-actions .thg-ebay-button.small a {
    padding: 4px 8px;
}

.gem-details .thg-ebay-button:hover,
.sale-actions .thg-ebay-button:hover {
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.gem-details .thg-ebay-button:hover a,
.sale-actions .thg-ebay-button:hover a {
    color: #1e7e34;
}

/* Chart Containers */
.card-content canvas {
    max-width: 100%;
    height: auto !important;
}

/* Loading States */
.analytics-card.loading {
    opacity: 0.6;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .thg-hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-stat-item {
        padding: 20px 15px;
    }
    
    .stat-value {
        font-size: 1.8em;
    }
    
    .thg-analytics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .filter-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .analytics-filter {
        width: 100%;
        min-width: auto;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-content {
        padding: 15px;
    }
    
    .top-sale-item,
    .traded-card-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .sale-price {
        align-self: flex-end;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .thg-hero-stats {
        grid-template-columns: 1fr;
    }
    
    .thg-analytics-filters {
        padding: 15px;
    }
    
    .preset-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 1.6em;
    }
    
    .parallel-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .parallel-stats {
        align-items: flex-start;
        width: 100%;
    }
    
    .gem-item {
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }
    
    .gem-image {
        width: 50px;
        height: 70px;
    }
    
    .gem-stats {
        flex-direction: column;
        gap: 4px;
    }
    
    .recent-sale-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .sale-actions {
        align-items: flex-start;
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
    }
    
    .sale-meta {
        flex-wrap: wrap;
    }
}

/* Print Styles */
@media print {
    .thg-analytics-container {
        background: none !important;
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .thg-analytics-filters {
        display: none !important;
    }
    
    /* Don't hide enhanced chart filters when printing */
    .thg-enhanced-filters .thg-filters-content {
        display: none !important;
    }
    
    .analytics-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        margin-bottom: 20px !important;
    }
    
    .card-header {
        background: #f8f9fa !important;
    }
    
    .stat-change,
    .parallel-type,
    .condition,
    .sales-count {
        background: #6c757d !important;
        color: white !important;
    }
}

/* Accessibility Improvements */
.analytics-filter:focus-visible,
.preset-btn:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.analytics-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .analytics-card {
        border: 2px solid #000;
    }
    
    .card-header {
        background: #000;
        color: #fff;
    }
    
    .stat-change.positive {
        background: #008000;
    }
    
    .stat-change.negative {
        background: #800000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .analytics-card,
    .hero-stat-item,
    .preset-btn,
    .top-sale-item,
    .analytics-filter {
        transition: none;
    }
    
    .preset-btn:hover,
    .preset-btn.active {
        transform: none;
    }
    
    .analytics-card:hover {
        transform: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}