/* Custom styles beyond Tailwind */

/* Smooth transitions */
.transition-all {
    transition: all 0.3s ease;
}

/* Input styling */
.form-select,
.form-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background-color: #f8fafc;
    transition: all 0.3s ease;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Tooltip styling */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #1f2937;
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Scenario buttons */
.scenario-btn {
    transition: all 0.3s ease;
}

.scenario-btn.active {
    background-color: #3b82f6;
    color: white;
}

/* Table styling */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .container {
        padding: 0.75rem;
    }
    
    .grid {
        gap: 0.75rem;
    }
    
    .text-4xl {
        font-size: 1.875rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
    
    .p-6 {
        padding: 1rem;
    }
    
    /* Mobile input improvements */
    .form-input, .w-full input[type="number"] {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Mobile button improvements */
    button {
        min-height: 44px; /* iOS recommended touch target */
    }
    
    /* Mobile table improvements */
    .table-wrapper {
        font-size: 0.875rem;
    }
    
    /* Chart height adjustment for mobile */
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .text-2xl, .text-xl {
        font-size: 1rem;
    }
    
    .p-4 {
        padding: 0.75rem;
    }
    
    /* Smaller KPI cards on very small screens */
    .metric-card p {
        font-size: 1.25rem;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* Print styles for PDF export */
@media print {
    body {
        background: none;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .no-print {
        display: none;
    }
    
    .page-break {
        page-break-before: always;
    }
}