/* 
===========================================
FINANCIAL ANALYTICS NON-CRITICAL CSS
File: financial-analytics-non-critical.css
Location: /wp-content/themes/blocksy/css/
===========================================
*/

/* Table Controls */
.table-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-50, #f9fafb);
    border-radius: 8px;
    border: 1px solid var(--gray-200, #e5e7eb);
}

.table-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-button {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: var(--gray-700, #374151);
}

.tab-button:hover {
    background: var(--gray-100, #f3f4f6);
    transform: translateY(-1px);
}

.tab-button.active {
    background: var(--primary-blue, #3b82f6);
    color: white;
    border-color: var(--primary-blue, #3b82f6);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: var(--gray-700, #374151);
}

.action-button:hover {
    background: var(--gray-100, #f3f4f6);
    transform: translateY(-1px);
}

/* Insights Sidebar */
.insights-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.insight-tip {
    background: linear-gradient(135deg, var(--gray-50, #f9fafb) 0%, white 100%);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.insight-tip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.insight-tip h3 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-800, #1f2937);
}

.insight-tip p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    color: var(--gray-700, #374151);
}

/* Data Visualization */
.data-visualization {
    margin: 3rem 0;
}

.viz-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200, #e5e7eb);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viz-placeholder {
    text-align: center;
    color: var(--gray-700, #374151);
    padding: 2rem;
    width: 100%;
}

.placeholder-bar {
    border-radius: 4px;
    background: var(--gray-200, #e5e7eb);
    margin: 10px auto;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 0.6; 
        transform: scaleY(1);
    }
    50% { 
        opacity: 0.3; 
        transform: scaleY(0.95);
    }
}

/* Detail buttons in tables */
.detail-button {
    padding: 0.375rem 0.75rem;
    background: var(--gray-100, #f3f4f6);
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray-700, #374151);
}

.detail-button:hover {
    background: var(--gray-200, #e5e7eb);
    transform: translateY(-1px);
}

/* Performance table enhancements */
.performance-table .growth-cell,
.performance-table .momentum-cell {
    font-weight: 600;
    font-size: 0.9375rem;
}

.performance-table .positive {
    color: var(--primary-green, #10b981);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), transparent);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

.performance-table .negative {
    color: var(--primary-red, #ef4444);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), transparent);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

.performance-table .ticker-cell {
    font-weight: 600;
    color: var(--gray-800, #1f2937);
}

/* Responsive enhancements for very small screens */
@media (max-width: 480px) {
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-tabs {
        justify-content: center;
    }
    
    .table-actions {
        justify-content: center;
    }
    
    .tab-button,
    .action-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .insight-tip {
        padding: 1.25rem;
    }
    
    .viz-container {
        padding: 1.5rem;
    }
}

/* Print styles */
@media print {
    .table-controls,
    .action-button,
    .detail-button,
    .insights-sidebar {
        display: none !important;
    }
    
    .analytics-dashboard {
        box-shadow: none !important;
        border: none !important;
    }
    
    .performance-table {
        break-inside: avoid;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .financial-leaders-dashboard {
        --gray-50: #1f2937;
        --gray-100: #374151;
        --gray-200: #4b5563;
        --gray-300: #6b7280;
        --gray-700: #d1d5db;
        --gray-800: #e5e7eb;
    }
    
    .metric-card,
    .commentary-card,
    .viz-container,
    .insight-tip,
    .leaderboard-card,
    .featured-card,
    .comparison-card {
        background: var(--gray-50, #1f2937);
        border-color: var(--gray-100, #374151);
    }
    
    .performance-table th {
        background: var(--gray-100, #374151);
        color: var(--gray-300, #6b7280);
    }
    
    .tab-button:not(.active),
    .action-button {
        background: var(--gray-100, #374151);
        border-color: var(--gray-200, #4b5563);
        color: var(--gray-300, #6b7280);
    }
    
    .tab-button:not(.active):hover,
    .action-button:hover {
        background: var(--gray-200, #4b5563);
    }
    
    .detail-button {
        background: var(--gray-100, #374151);
        border-color: var(--gray-200, #4b5563);
        color: var(--gray-300, #6b7280);
    }
    
    .placeholder-bar {
        background: var(--gray-200, #4b5563);
    }
}

/* Loading states */
.loading-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500, #6b7280);
    font-style: italic;
}

/* Animation for tab transitions */
.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom scrollbar for table containers */
.responsive-table-container::-webkit-scrollbar {
    height: 6px;
}

.responsive-table-container::-webkit-scrollbar-track {
    background: var(--gray-100, #f3f4f6);
    border-radius: 3px;
}

.responsive-table-container::-webkit-scrollbar-thumb {
    background: var(--gray-300, #d1d5db);
    border-radius: 3px;
}

.responsive-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400, #9ca3af);
}

/* Hover effects for interactive elements */
.metric-card:hover .metric-icon {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.leaderboard-card:hover .leaderboard-header {
    background-position: 100% 0;
    transition: background-position 0.5s ease;
}

/* Focus states for accessibility */
.tab-button:focus,
.action-button:focus,
.detail-button:focus {
    outline: 2px solid var(--primary-blue, #3b82f6);
    outline-offset: 2px;
}

/* Performance optimization for animations */
@media (prefers-reduced-motion: reduce) {
    .tab-content,
    .metric-card,
    .insight-tip,
    .leaderboard-card,
    .featured-card,
    .metric-icon,
    .tab-button,
    .action-button,
    .detail-button {
        animation: none !important;
        transition: none !important;
    }
    
    .placeholder-bar {
        animation: none;
    }
}

/* Custom utilities for financial dashboard */
.financial-note {
    font-size: 0.875rem;
    color: var(--gray-600, #4b5563);
    font-style: italic;
    border-left: 3px solid var(--primary-blue, #3b82f6);
    padding-left: 1rem;
    margin: 1rem 0;
}

.financial-highlight {
    background: linear-gradient(120deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    margin: 1rem 0;
}

.financial-warning {
    background: linear-gradient(120deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin: 1rem 0;
}

/* AdSense-friendly spacing */
.adsense-container {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--gray-50, #f9fafb);
    border-radius: 8px;
    text-align: center;
    border: 1px dashed var(--gray-300, #d1d5db);
}

.adsense-placeholder {
    color: var(--gray-500, #6b7280);
    font-size: 0.875rem;
    padding: 3rem 1rem;
}

/* Ensure proper z-index for dropdowns/modals */
.tab-content,
.leaderboard-section,
.insight-tip {
    position: relative;
    z-index: 1;
}

/* Ensure images are responsive */
.financial-leaders-dashboard img,
.analytics-dashboard img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography enhancements for financial data */
.financial-number {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace, sans-serif;
}

/* Grid fallback for older browsers */
@supports not (display: grid) {
    .metrics-grid,
    .featured-grid,
    .trends-grid,
    .comparison-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .metric-card,
    .featured-card,
    .trend-card,
    .comparison-card {
        flex: 1 1 250px;
        margin: 0.5rem;
    }
}