/* Modern Design System - Fintech Decider */

:root {
    /* Color Palette - Indigo & Slate */
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --secondary-color: #64748b;
    /* Slate 500 */
    --accent-color: #0ea5e9;
    /* Sky 500 */

    --success-color: #10b981;
    /* Emerald 500 */
    --warning-color: #f59e0b;
    /* Amber 500 */
    --danger-color: #ef4444;
    /* Red 500 */
    --info-color: #3b82f6;
    /* Blue 500 */

    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    /* Slate 100 */

    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */

    --border-color: #e2e8f0;
    /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Global Styles */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
    padding: 1rem 0;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.025em;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    font-weight: 600;
}

.card,
.stForm,
div[data-testid="metric-container"],
div[data-testid="stPlotlyChart"] {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.stForm {
    padding: 2rem;
    margin-bottom: 2rem;
}

div[data-testid="metric-container"] {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Hover Effects */
.card:hover,
.stForm:hover,
div[data-testid="metric-container"]:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Forms & Inputs */
.form-control,
.form-select,
.stTextInput input,
.stNumberInput input,
.stSelectbox select,
.stDateInput input {
    background-color: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    width: 100%;
    display: block;
}

.form-control:focus,
.form-select:focus,
.stTextInput input:focus,
.stNumberInput input:focus,
.stSelectbox select:focus,
.stDateInput input:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Buttons */
.btn,
.stButton>button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary,
.stButton>button {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover,
.stButton>button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
}

.stButton button[kind="formSubmit"] {
    background-color: var(--success-color);
    width: 100%;
    margin-top: 1rem;
}

.stButton button[kind="formSubmit"]:hover {
    background-color: #059669;
    /* Emerald 600 */
}

/* Metrics */
div[data-testid="metric-container"]>div:first-child {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

div[data-testid="metric-container"]>div:nth-child(2) {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Success/Error States */
.eligible-card {
    border-left: 4px solid var(--success-color);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.05), transparent);
}

.rejected-card {
    border-left: 4px solid var(--danger-color);
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), transparent);
}

/* Alerts */
.alert,
div[data-testid="alert"] {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.alert-success,
div[data-testid="alert"][data-baseweb="notification"] {
    background-color: #ecfdf5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-danger,
div[data-testid="alert"][data-baseweb="notification"].st-emotion-cache-1wivap2 {
    background-color: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Footer */
footer {
    font-size: 0.875rem;
}

/* Autocomplete */
.autocomplete-suggestions {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    z-index: 1000;
    margin-top: 4px;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.1s;
}

.suggestion-item:hover {
    background-color: var(--bg-input);
    color: var(--primary-color);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: fadeIn 0.5s ease-out;
}

/* Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .stForm {
        padding: 1.5rem;
    }

    .page-title {
        font-size: 1.75rem;
    }
}