/* Custom Styles for Company Financial Comparison Tool */

:root {
    --primary-color: #0d6efd;
    --primary-hover-color: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
    --muted-color: #6c757d;
}

/* General Styles */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

/* Control Panel Styles */
.ticker-btn {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: bold;
    transition: all 0.2s ease;
}

.ticker-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ticker-btn.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.control-steps .step-card {
    border: 1px solid rgba(13, 110, 253, 0.15);
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 0.25rem 0.75rem rgba(13, 110, 253, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.control-steps .step-index {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.35);
}

.kpi-search-group .form-control {
    min-width: 200px;
}

.kpi-item {
    transition: all 0.2s ease;
}

.kpi-item:hover {
    transform: translateY(-2px);
}

#selectedKpiBadge {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
}

.border-dashed {
    border-style: dashed !important;
}

@media (max-width: 576px) {
    .kpi-search-group {
        width: 100% !important;
    }

    .kpi-search-group .form-control {
        min-width: 0;
        width: 100%;
    }
}

/* KPI Selection Styles */
.form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.kpi-checkbox + label {
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.kpi-checkbox:checked + label {
    color: var(--success-color);
    font-weight: 500;
}

.comparison-controls .input-group-text {
    background-color: var(--light-color);
    border-color: #ced4da;
}

.comparison-controls .form-control,
.comparison-controls .form-select {
    border-radius: 0.375rem;
}

.comparison-controls .btn {
    white-space: nowrap;
}

.kpi-info-btn {
    color: var(--info-color);
    text-decoration: none;
}

.kpi-info-btn:hover,
.kpi-info-btn:focus {
    color: var(--primary-color);
    text-decoration: none;
}

.kpi-header-info {
    color: var(--info-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.kpi-header-info:hover,
.kpi-header-info:focus {
    color: var(--primary-color);
}

.kpi-header-filter {
    color: var(--secondary-color);
    background: transparent;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

.kpi-header-filter:hover,
.kpi-header-filter:focus {
    color: var(--primary-color);
}

.kpi-header-filter.active {
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 3px;
    padding: 2px 4px;
}

.initially-hidden {
    display: none;
}

/* Loading Indicator */
.spinner-border {
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* DataTable Customizations */
.dataTables_wrapper {
    padding-top: 0;
}

.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
}

.dataTables_length select {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

#comparisonTable {
    font-size: 0.9rem;
}

#comparisonTable thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--dark-color);
    white-space: nowrap;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#comparisonTable thead th:hover {
    background-color: #f8f9fa;
}

.sortable-column {
    position: relative;
}

.sort-indicator {
    font-size: 0.75em;
    margin-left: 0.25rem;
    transition: all 0.2s ease;
}

.sort-indicator.text-primary {
    color: var(--primary-color) !important;
}

.sort-indicator.text-muted {
    color: #6c757d !important;
    opacity: 0.6;
}

#comparisonTable thead th:hover .sort-indicator.text-muted {
    opacity: 1;
}

#comparisonTable tbody td {
    padding: 0.5rem;
    vertical-align: middle;
}

/* Ticker column styling */
#comparisonTable .ticker-cell {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: bold;
    color: var(--primary-color);
}

/* Numeric value styling */
.numeric-value {
    text-align: right;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Positive/Negative value indicators */
.positive-value {
    color: var(--success-color);
}

.negative-value {
    color: var(--danger-color);
}

/* N/A value styling */
.na-value {
    color: #6c757d;
    font-style: italic;
}

.column-filter-panel {
    position: absolute;
    z-index: 1080;
    width: 240px;
    border: none;
    border-radius: 0.5rem;
}

.column-filter-panel .card-body {
    padding: 0.75rem;
}

.column-filter-panel .column-filter-title {
    font-size: 0.9rem;
}

.column-filter-panel .column-filter-input {
    font-size: 0.85rem;
}

/* Cache status indicators */
.cache-fresh {
    background-color: var(--success-color);
}

.cache-fetched {
    background-color: var(--info-color);
}

/* Compact KPI Selection Styles */
.kpi-multi-select-container {
    position: relative;
}

.kpi-search-input {
    position: relative;
}

.kpi-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1050;
    max-height: 400px;
    overflow: hidden;
    display: none;
}

.kpi-dropdown.show {
    display: block;
}

.kpi-dropdown-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.kpi-dropdown-body {
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.kpi-category-group {
    margin-bottom: 0.5rem;
}

.kpi-category-header {
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 1;
}

.kpi-category-header i {
    width: 16px;
    text-align: center;
}

.kpi-dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kpi-dropdown-item:hover {
    background-color: #f8f9fa;
}

.kpi-dropdown-item.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

.kpi-dropdown-item .form-check-input {
    margin: 0;
}

.kpi-dropdown-item-content {
    flex: 1;
}

.kpi-dropdown-item-name {
    font-weight: 500;
    line-height: 1.2;
}

.kpi-dropdown-item-description {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.3;
    margin-top: 0.125rem;
}

/* Selected KPI Chips */
.selected-kpi-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
}

.selected-kpi-chips:empty + #noKPIsSelected {
    display: block !important;
}

/* Legacy kpi-chip styles - overridden by unified styles below */

/* Legacy category styles - disabled for unified black styling
.kpi-chip.category-basic {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.kpi-chip.category-valuation {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

.kpi-chip.category-profitability {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
}

.kpi-chip.category-growth {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.kpi-chip.category-financial {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
}
*/

.kpi-chip-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.kpi-chip-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* KPI Preset Buttons */
.kpi-preset {
    position: relative;
    transition: all 0.2s ease;
}

.kpi-preset.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.kpi-preset:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Quick Access Buttons */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .kpi-dropdown {
        max-height: 300px;
    }
    
    .selected-kpi-chips {
        gap: 0.25rem;
    }
    
    .kpi-chip {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .kpi-preset {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
}

/* Animation for dropdown */
.kpi-dropdown {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty state styling */
#noKPIsSelected {
    display: none;
}

/* Results Summary Cards */
.results-summary .fa-2x {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    #comparisonTable {
        font-size: 0.8rem;
    }
    
    #comparisonTable thead th,
    #comparisonTable tbody td {
        padding: 0.25rem;
    }
    
    .ticker-btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* DataTable responsive design */
@media screen and (max-width: 767px) {
    .dtr-details {
        background-color: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 0.75rem;
        margin-top: 0.5rem;
    }
    
    .dtr-details li {
        border-bottom: 1px solid #dee2e6;
        padding: 0.5rem 0;
    }
    
    .dtr-details li:last-child {
        border-bottom: none;
    }
}

/* Custom scrollbar for table */
.dataTables_scrollBody::-webkit-scrollbar {
    height: 8px;
}

.dataTables_scrollBody::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation for row updates */
.row-updated {
    animation: highlightRow 2s ease-in-out;
}

@keyframes highlightRow {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

/* Export button styling */
.dt-buttons {
    margin-bottom: 1rem;
}

.dt-button {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    margin-right: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.dt-button:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

/* AI Insights */
.ai-card .card-header {
    background-color: rgba(13, 110, 253, 0.05);
    border-bottom: none;
}

.ai-prompt-pills .ai-prompt-pill {
    border-radius: 999px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.ai-prompt-pills .ai-prompt-pill:hover,
.ai-prompt-pills .ai-prompt-pill:focus {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.ai-insights-output {
    border: 1px solid rgba(13, 110, 253, 0.15);
    border-radius: 0.75rem;
    background: #f8fbff;
    padding: 1rem 1.25rem;
    min-height: 140px;
}
.ai-model-description {
    min-height: 3rem;
    line-height: 1.4;
}

.ai-insights-meta {
    border-left: 3px solid var(--bs-border-color);
    padding-left: 0.75rem;
}

.ai-analysis-text p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.ai-analysis-text p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .ai-insights-output {
        padding: 0.75rem 1rem;
    }
}

/* Status badges */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

/* Enhanced Company Selection */
.ticker-search-width {
    width: 200px;
}

.ticker-category-section {
    border-left: 3px solid var(--bs-border-color);
    padding-left: 0.75rem;
}

.ticker-btn[data-category="tech"] {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
}

.ticker-btn[data-category="finance"] {
    --bs-btn-color: var(--bs-success);
    --bs-btn-border-color: var(--bs-success);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--bs-success);
    --bs-btn-hover-border-color: var(--bs-success);
}

.ticker-btn[data-category="healthcare"] {
    --bs-btn-color: var(--bs-info);
    --bs-btn-border-color: var(--bs-info);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--bs-info);
    --bs-btn-hover-border-color: var(--bs-info);
}

.ticker-btn[data-category="consumer"] {
    --bs-btn-color: var(--bs-warning);
    --bs-btn-border-color: var(--bs-warning);
    --bs-btn-hover-color: #000;
    --bs-btn-hover-bg: var(--bs-warning);
    --bs-btn-hover-border-color: var(--bs-warning);
}

/* Enhanced KPI Selection */
.kpi-card {
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 0.5rem;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-card.border-primary {
    border-width: 2px !important;
}

.category-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

.kpi-category-tabs .btn-check:checked + .btn {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

#tickerCount {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

@media (max-width: 768px) {
    .ticker-search-width {
        width: 100%;
    }
    
    .kpi-card {
        margin-bottom: 0.75rem;
    }
    
    .btn-group-sm .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Make KPI category buttons stack vertically on mobile */
    .btn-group[aria-label="KPI Categories"] {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group[aria-label="KPI Categories"] .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
    
    /* Improve ticker category layout on mobile */
    .ticker-category-section h6 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    /* Better mobile spacing for control cards */
    .card-body {
        padding: 0.75rem;
    }
    
    /* Responsive ticker input */
    .input-group-lg .form-control {
        font-size: 1rem;
    }
    
    /* Improve button group layout */
    .btn-group .btn {
        flex: 1;
        min-width: 0;
        font-size: 0.8rem;
    }
}

/* Tablet specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .kpi-card {
        min-height: 120px;
    }
    
    .ticker-btn {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
    
    .btn-group-sm .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

/* New Analysis Builder Interface */
.analysis-builder {
    max-width: 1400px;
    margin: 0 auto;
}

.analysis-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    overflow: hidden;
}

.template-btn {
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 0.25rem;
}

.template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Builder Cards */
.builder-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.builder-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.step-indicator {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-number {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Company Search */
.company-search-container {
    position: relative;
}

.search-input-group {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-results-dropdown.show {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: between;
}

.search-result-item:hover,
.search-result-item.highlighted {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-ticker {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: bold;
    color: var(--bs-primary);
    font-size: 0.9rem;
    min-width: 60px;
}

.search-result-name {
    font-weight: 500;
    color: var(--bs-dark);
    flex: 1;
    margin: 0 0.5rem;
}

.search-result-sector {
    font-size: 0.8rem;
    color: var(--bs-secondary);
    font-style: italic;
}

/* Enhanced Search Results */
.search-result-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.search-result-item.priority-high {
    border-left-color: #28a745;
}

.search-result-item.priority-medium {
    border-left-color: #ffc107;
}

.search-result-item.priority-low {
    border-left-color: #6c757d;
}

.search-result-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.2rem;
}

.search-result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.match-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.match-badge.exact {
    background: #28a745;
    color: white;
}

.match-badge.ticker {
    background: var(--primary-color);
    color: white;
}

.match-badge.name {
    background: #ffc107;
    color: #212529;
}

.match-badge.sector {
    background: #6c757d;
    color: white;
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
}

.search-help-text {
    font-size: 0.85rem;
    color: #adb5bd;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.search-stats-text {
    font-size: 0.75rem;
    color: #28a745;
    margin-top: 0.5rem;
    font-weight: 500;
}

.search-results-footer {
    border-top: 1px solid #e9ecef;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 0 0 0.375rem 0.375rem;
}

.search-stats {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

/* Loading state for company search */
.company-search-container.loading-companies::after {
    content: "Loading companies...";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
    z-index: 1000;
}

.company-search-container.loading-companies input {
    background-image: url("data:image/svg+xml;charset=utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c757d'><path d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z' opacity='0.25'/><path d='M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z'><animateTransform attributeName='transform' type='rotate' dur='0.75s' values='0 12 12;360 12 12' repeatCount='indefinite'/></path></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

/* Selected Items (Chips) */
.selected-companies,
.selected-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border: 2px dashed #dee2e6;
    transition: all 0.2s ease;
}

.selected-companies.has-items,
.selected-kpis.has-items {
    background: #fff;
    border-color: #0d6efd;
    border-style: solid;
}

.company-chip,
.kpi-chip,
.metric-chip {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 
        0 0.4rem 0.8rem rgba(0, 0, 0, 0.25),
        0 0.2rem 0.4rem rgba(0, 0, 0, 0.15),
        0 0.1rem 0.2rem rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.metric-chip.selected {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
    color: white;
    box-shadow: 
        0 0.4rem 0.8rem rgba(0, 0, 0, 0.25),
        0 0.2rem 0.4rem rgba(0, 0, 0, 0.15),
        0 0.1rem 0.2rem rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.metric-chip .chip-action {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

.metric-chip.selected .chip-action {
    color: white;
    opacity: 1;
}

.company-chip:hover,
.kpi-chip:hover,
.metric-chip:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 0.8rem 1.6rem rgba(0, 0, 0, 0.3),
        0 0.4rem 0.8rem rgba(0, 0, 0, 0.2),
        0 0.2rem 0.4rem rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
}

/* Ensure all chip types have identical styling - override any category or state-specific styles */
.company-chip,
.kpi-chip,
.metric-chip,
.metric-chip.selected,
.kpi-chip.selected,
.company-chip.selected,
.available-metric-chip {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
    color: white !important;
    box-shadow: 
        0 0.4rem 0.8rem rgba(0, 0, 0, 0.25),
        0 0.2rem 0.4rem rgba(0, 0, 0, 0.15),
        0 0.1rem 0.2rem rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.company-chip:hover,
.kpi-chip:hover,
.metric-chip:hover,
.metric-chip.selected:hover,
.kpi-chip.selected:hover,
.company-chip.selected:hover,
.available-metric-chip:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    box-shadow: 
        0 0.8rem 1.6rem rgba(0, 0, 0, 0.3),
        0 0.4rem 0.8rem rgba(0, 0, 0, 0.2),
        0 0.2rem 0.4rem rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

/* Chip Content Styling */
.chip-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 0.5rem;
    flex: 1;
    min-width: 0;
}

.chip-secondary {
    font-size: 0.7rem;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.chip-primary {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.chip-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chip-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Popular Companies */
.popular-category {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.popular-category-title {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.popular-tickers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.popular-ticker {
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: bold;
    color: var(--bs-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
}

.popular-ticker:hover {
    background: var(--bs-primary);
    color: white;
    transform: translateY(-1px);
}

.popular-ticker.selected {
    background: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.popular-ticker.selected:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* KPI Search */
.kpi-search-container {
    position: relative;
}

.kpi-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-search-results.show {
    display: block;
}

.kpi-search-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.kpi-search-item:hover,
.kpi-search-item.highlighted {
    background-color: #f8f9fa;
}

.kpi-search-item:last-child {
    border-bottom: none;
}

.kpi-search-name {
    font-weight: 500;
    color: var(--bs-dark);
    font-size: 0.9rem;
}

.kpi-search-description {
    font-size: 0.75rem;
    color: var(--bs-secondary);
    margin-top: 0.1rem;
}

/* KPI Quick Access */
.kpi-quick-access {
    margin-top: 1rem;
}

.kpi-category-btn {
    height: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.kpi-category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-category-btn div {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
}

.kpi-category-btn small {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 0.2rem;
    line-height: 1;
}

/* Analysis Preview */
.analysis-preview {
    top: 2rem;
}

.analysis-preview-content {
    min-height: 200px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.preview-item {
    display: flex;
    align-items: center;
    justify-content: between;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.preview-item-type {
    font-weight: 600;
    color: var(--bs-primary);
    min-width: 80px;
}

.preview-item-count {
    color: var(--bs-secondary);
    font-size: 0.8rem;
}

/* Smart Suggestions */
.suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.suggestion-item:hover {
    background: #e9ecef;
    border-color: var(--bs-primary);
}

.suggestion-icon {
    width: 2rem;
    height: 2rem;
    background: var(--bs-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.suggestion-content {
    flex: 1;
}

.suggestion-title {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--bs-dark);
    margin-bottom: 0.1rem;
}

.suggestion-description {
    font-size: 0.75rem;
    color: var(--bs-secondary);
    line-height: 1.2;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-up {
    animation: slideInUp 0.3s ease;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Responsive Design for New Interface */
@media (max-width: 992px) {
    .analysis-preview {
        position: static;
        margin-top: 2rem;
    }
    
    .step-indicator {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .step-number {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .template-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        width: 48%;
        margin: 0.1rem;
    }
    
    .kpi-category-btn {
        height: 3.5rem;
    }
    
    .kpi-category-btn div {
        font-size: 0.8rem;
    }
    
    .kpi-category-btn small {
        font-size: 0.65rem;
    }
    
    .company-chip,
    .kpi-chip {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .search-result-item {
        padding: 0.5rem 0.75rem;
    }
    
    .popular-category {
        padding: 0.5rem;
    }
}

/* Error and success states */
.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-warning {
    background-color: #fff3cd;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #d1ecf1;
    border-left: 4px solid var(--info-color);
}

/* Loading states */
.loading-overlay {
    position: relative;
}

.loading-overlay::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;
    z-index: 10;
}

/* ==========================================
   KPI Categories and Info System
   ========================================== */

.metrics-categories-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.metrics-category {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fafbfc;
    overflow: hidden;
}

.metrics-category-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.metrics-category-header i {
    color: #6366f1;
    font-size: 1rem;
}

.category-name {
    flex: 1;
    font-size: 0.95rem;
}

.category-count {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 400;
}

.metrics-category-content {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Enhanced Metric Chip Styling */
.metric-chip .chip-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.metric-chip .chip-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.2rem;
    border-radius: 50%;
}

.metric-chip .chip-info:hover {
    color: #fbbf24;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.metric-chip .chip-action {
    font-size: 0.8rem;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.metric-chip.selected .chip-action {
    color: white;
    opacity: 1;
}

/* KPI Tooltip Styling */
.kpi-tooltip {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 350px;
    min-width: 300px;
    font-size: 0.9rem;
    animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-tooltip-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem 0.75rem 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-tooltip-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.kpi-tooltip-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.kpi-tooltip-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.kpi-tooltip-content {
    padding: 1rem;
}

.kpi-description {
    margin-bottom: 0.75rem;
}

.kpi-description strong {
    color: #374151;
    font-weight: 600;
}

.kpi-description p {
    margin: 0.5rem 0 0 0;
    color: #6b7280;
    line-height: 1.5;
}

.kpi-category {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.kpi-category strong {
    color: #374151;
}

.kpi-key {
    font-size: 0.85rem;
    color: #6b7280;
}

.kpi-key strong {
    color: #374151;
}

.kpi-key code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    color: #4f46e5;
}

/* ==========================================
   Selected Items Containers
   ========================================== */

.selected-metrics-container {
    min-height: 60px;
    padding: 1rem;
    background: #fafbfc !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    transition: border-color 0.2s ease;
}

/* Ensure both selected containers have identical styling */
#selectedCompaniesContainer,
#selectedMetricsDisplay {
    min-height: 60px;
    padding: 1rem;
    background: #fafbfc !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    transition: border-color 0.2s ease;
}

.selected-metrics-container:focus-within,
#selectedCompaniesContainer:focus-within,
#selectedMetricsDisplay:focus-within {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.selected-metrics-container .empty-state {
    color: #9ca3af;
    font-style: italic;
    width: 100%;
    text-align: center;
    padding: 0.5rem;
}

.selected-metrics-container .empty-state i {
    opacity: 0.5;
}

/* ==========================================
   Index Selection Buttons
   ========================================== */

.index-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.index-preset-btn {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    color: #374151;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    min-height: 80px;
}

.index-preset-btn:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #4f46e5;
}

.index-preset-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.index-preset-btn i {
    font-size: 1.5rem;
    color: #6366f1;
    margin-right: 0.75rem;
    min-width: 24px;
}

.index-btn-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.index-name {
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
    line-height: 1.2;
}

.index-count {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 400;
}

.index-preset-btn:hover .index-name {
    color: #4f46e5;
}

.index-preset-btn:hover .index-count {
    color: #6366f1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .index-buttons-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .index-preset-btn {
        padding: 0.875rem 1rem;
        min-height: 70px;
    }
    
    .index-preset-btn i {
        font-size: 1.25rem;
        margin-right: 0.5rem;
    }
    
    .index-name {
        font-size: 0.95rem;
    }
    
    .index-count {
        font-size: 0.8rem;
    }
}

/* Advanced Search Styles */
.advanced-search-toggle {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.advanced-search-toggle:hover {
    background-color: #f8f9fa;
}

.advanced-search-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.advanced-search-content {
    display: none;
}

#advancedSearchChevron {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

#advancedSearchResult .alert {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Compact alert styling */
.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

/* Simple Auto-refresh Toggle */
.form-check-input[type="checkbox"] {
    width: 3rem;
    height: 1.5rem;
    background-color: #e9ecef;
    border: 2px solid #dee2e6;
    border-radius: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.form-check-input[type="checkbox"]:checked {
    background-color: #28a745;
    border-color: #28a745;
}

.form-check-input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    background-color: white;
    border-radius: 50%;
    top: 50%;
    left: 0.125rem;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.form-check-input[type="checkbox"]:checked::before {
    left: 1.625rem;
}

/* Professional Analysis Summary Section */
.analysis-summary {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-card .stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-size: 1.25rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 0.25rem;
}

/* Special styling for update timestamp */
.update-stat .stat-timestamp {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.timestamp-date {
    font-size: 1.125rem;
    font-weight: 600;
    color: #059669;
    line-height: 1.2;
}

.timestamp-time {
    font-size: 0.875rem;
    color: #6b7280;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Export actions styling */
.export-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.export-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.export-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive design */
@media (max-width: 768px) {
    .analysis-summary {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-card .stat-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.875rem;
    }
    
    .timestamp-date {
        font-size: 1rem;
    }
}

/* Financial Comparison Table Styles - Aligned with Branding */
.financial-table-container {
    margin: 2rem 0;
}



.financial-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background-color: white;
}

.financial-table thead th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 1rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.financial-table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #dee2e6;
}

.financial-table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.financial-table td {
    padding: 0.75rem;
    vertical-align: middle;
    text-align: center;
    border-right: 1px solid #dee2e6;
}

.financial-table td:last-child {
    border-right: none;
}

.table-wrapper {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: white;
}

.stat-item {
    padding: 0.5rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Quick Filter Buttons */
.btn-outline-primary.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Sort Indicators Enhancement */
.sortable-column {
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: background-color 0.2s ease;
}

.sortable-column:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sort-indicator {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.sort-indicator.text-primary {
    opacity: 1;
    transform: scale(1.1);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .financial-table-container .card-header {
        padding: 1rem;
    }
    
    .financial-table-container .card-header h2 {
        font-size: 1.25rem;
    }
    
    .table-controls-bar {
        padding: 1rem;
    }
    
    .table-controls-bar .row {
        gap: 1rem;
    }
    
    .table-controls-bar .col-md-6 {
        width: 100%;
    }
    
    .financial-table {
        font-size: 0.75rem;
    }
    
    .stat-item {
        margin-bottom: 1rem;
    }
}

/* Loading Animation */
@keyframes pulse-table {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.table-loading .financial-table {
    animation: pulse-table 1.5s ease-in-out infinite;
}

/* Enhanced Action Buttons */
.btn-group-actions {
    gap: 0.75rem;
}

.btn-group-actions .btn {
    min-width: 140px;
    transition: all 0.2s ease;
}

.btn-group-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .btn-group-actions .btn {
        min-width: 120px;
        font-size: 0.875rem;
    }
}

/* Timestamp formatting in table info */
.table-info #lastUpdated {
    white-space: nowrap;
    font-weight: normal;
    font-size: inherit;
}

.table-info .timestamp-date {
    margin-right: 0.25rem;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

.table-info .timestamp-time {
    font-weight: inherit;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
}

/* DataTable Pagination Button Styling */
.dataTables_paginate {
    margin-top: 1rem !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.dataTables_paginate .paginate_button {
    display: inline-block !important;
    padding: 0.5rem 0.75rem !important;
    margin: 0 0.125rem !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
    background: #ffffff !important;
    color: #495057 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    line-height: 1.25 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.dataTables_paginate .paginate_button:hover {
    background: #e9ecef !important;
    border-color: #adb5bd !important;
    color: #212529 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3) !important;
}

.dataTables_paginate .paginate_button.current:hover {
    background: var(--primary-hover-color, #0b5ed7) !important;
    border-color: var(--primary-hover-color, #0b5ed7) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

.dataTables_paginate .paginate_button.disabled {
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    box-shadow: none !important;
}

.dataTables_paginate .paginate_button.disabled:hover {
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
    transform: none !important;
    box-shadow: none !important;
}

.dataTables_paginate .paginate_button.previous,
.dataTables_paginate .paginate_button.next {
    font-weight: 600 !important;
    padding: 0.5rem 1rem !important;
}

.dataTables_paginate .paginate_button.previous::before {
    content: "←" !important;
    margin-right: 0.25rem !important;
}

.dataTables_paginate .paginate_button.next::after {
    content: "→" !important;
    margin-left: 0.25rem !important;
}

/* AI Quick Prompts Styling */
.ai-quick-questions .ai-quick-question {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #495057;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    flex: 1;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-quick-questions .ai-quick-question:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.ai-quick-questions .ai-quick-question:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-quick-questions .ai-quick-question i {
    color: var(--secondary-color);
    transition: color 0.2s ease;
}

.ai-quick-questions .ai-quick-question:hover i {
    color: var(--primary-color);
}

.ai-quick-questions .ai-quick-question.btn-success {
    background: var(--success-color) !important;
    border-color: var(--success-color) !important;
    color: white !important;
    transform: translateY(0) !important;
}

.ai-quick-questions .ai-quick-question.btn-success i {
    color: white !important;
}

/* AI Generate Button Loading State */
.ai-analysis-button.btn-loading {
    cursor: not-allowed !important;
    opacity: 0.8;
}

.ai-analysis-button .fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* AI Analysis Results Styling */
.ai-analysis-results {
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-analysis-results .analysis-header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-radius: 1rem;
    color: white;
    padding: 1.5rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    border-bottom: none;
}

.ai-analysis-results .ai-badge {
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-analysis-results .analysis-content {
    line-height: 1.6;
}

.ai-analysis-results .analysis-section {
    background: var(--light-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
    border-left: 4px solid #4a5568;
}

.ai-analysis-results .section-header {
    margin-bottom: 1rem;
}

.ai-analysis-results .section-title {
    color: #4a5568;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.ai-analysis-results .section-title::before {
    content: "";
    width: 4px;
    height: 1.5rem;
    background: #4a5568;
    margin-right: 0.75rem;
    border-radius: 2px;
}

.ai-analysis-results .section-content {
    color: var(--dark-color, #495057);
}

.ai-analysis-results .section-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.ai-analysis-results .insight-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #dee2e6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ai-analysis-results .insight-number {
    width: 2rem;
    height: 2rem;
    background: #4a5568;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.ai-analysis-results .insight-content {
    flex: 1;
    line-height: 1.6;
}

.ai-analysis-results .insight-content strong {
    color: #4a5568;
    font-weight: 600;
}

.ai-analysis-results .bullet-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color, #e9ecef);
}

.ai-analysis-results .bullet-item strong {
    color: #4a5568;
    font-weight: 600;
}

.ai-analysis-results .text-primary {
    color: #4a5568 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ai-analysis-results {
        padding: 1rem;
    }
    
    .ai-analysis-results .ai-badge {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .ai-analysis-results .insight-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ai-analysis-results .insight-number {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
}
