/* Custom Styles for Financial Analysis System */

/* Variables */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Tab buttons active state */
.tab-btn.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

/* Cards hover effect */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.success {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.warning {
    background-color: #fed7aa;
    color: #92400e;
}

.status-badge.danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Charts container */
.chart-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Tooltip styles */
.custom-tooltip {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
}

/* Heatmap styles */
.heatmap-cell {
    width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid white;
    transition: all 0.2s ease;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Risk matrix styles */
.risk-item {
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.risk-item.high {
    border-left-color: var(--danger-color);
}

.risk-item.medium {
    border-left-color: var(--warning-color);
}

.risk-item.low {
    border-left-color: var(--success-color);
}

.risk-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Action plan timeline */
.timeline-item {
    position: relative;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid white;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .page-break {
        page-break-after: always;
    }
    
    body {
        font-size: 12px;
    }
    
    .chart-container {
        break-inside: avoid;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tab-btn {
        font-size: 0.875rem;
        padding: 0.75rem 0.5rem;
    }
    
    .tab-btn i {
        display: none;
    }
    
    .grid-cols-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* Scenario buttons */
.scenario-btn.active {
    border-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

/* Export buttons hover */
.export-btn {
    transition: all 0.3s ease;
}

.export-btn:hover {
    transform: scale(1.05);
}

/* Custom checkbox */
.custom-checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--primary-color);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.custom-checkbox:checked {
    background-color: var(--primary-color);
}

.custom-checkbox:checked::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.875rem;
    font-weight: bold;
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background-color: #fed7aa;
    color: #92400e;
    border: 1px solid #fdba74;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating action button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Data table enhancements */
.data-table th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.data-table tbody tr:hover {
    background-color: var(--light-color);
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

/* Chart legend custom */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 1rem;
    height: 1rem;
    border-radius: 0.125rem;
}