/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Modern Tailwind-like Palette */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --bg-body-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

body {
    background-color: #f8fafc;
    /* Solid off-white for mobile stability */
    background-image: none;
    /* Disable gradient on mobile to prevent paint flicker */
    background-attachment: scroll;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1e293b !important;
    /* Force slate-800 for contrast */
    line-height: 1.6;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    /* Better mobile fill */
    overflow-x: hidden;
}

/* Page Container centering */
.page-container {
    max-width: 100%;
    padding: 0 0.5rem;
    /* Reduced from 1rem */
}

@media (min-width: 768px) {
    body {
        background-color: transparent;
        background-image: var(--bg-body-gradient);
        background-attachment: fixed;
    }

    .page-container {
        padding: 0 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1000px;
        /* Focus mode */
    }
}

/* Card Styling - Glass / Floating Effect */
.card {
    background-color: #ffffff !important;
    /* Force solid white for mobile */
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    /* Larger radius */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /* Tailwind shadow-lg */
    margin-bottom: 2rem;
    /* overflow: hidden; Removed to fix mobile scroll issues */
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--slate-100);
    padding: 1.5rem;
    font-weight: 700;
    color: var(--slate-900);
    font-size: 1.1rem;
}

.card-body {
    padding: 2rem;
}

/* Buttons - Tailwind style */
.btn {
    border-radius: 9999px;
    /* Pill shape */
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
    /* Removed transitions on mobile/overall to prevent flickering during paint */
}

.btn-primary {
    background-color: var(--primary-600);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
    background-color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
    background-color: white;
    color: var(--slate-800);
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background-color: var(--slate-50);
    border-color: #cbd5e1;
    color: var(--slate-900);
}

.btn-outline-secondary {
    border-radius: 8px;
    /* Square for back buttons */
    border-color: #cbd5e1;
    color: var(--slate-800);
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
    color: var(--slate-900);
    letter-spacing: -0.025em;
    /* Tight letter spacing like Inter display */
}

.display-5 {
    font-weight: 800;
    color: var(--primary-600);
    /* Removed gradient text on mobile to fix flickering */
}

@media (min-width: 768px) {
    .display-5 {
        background: linear-gradient(to right, #2563eb, #1e40af);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

/* Form Inputs */
.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.875rem 1rem;
    /* Increased padding */
    background-color: #f8fafc;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    /* Add spacing below inputs */
}

.form-control:focus,
.form-select:focus {
    background-color: white;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    /* Tailwind ring */
    color: var(--slate-900);
    /* Ensure text is dark on white */
}

.input-group-text {
    background-color: #f1f5f9;
    color: var(--slate-600);
    border-color: #e2e8f0;
}

/* Fix input-group: reset global border-radius & margin-bottom that break grouping */
.input-group > .form-control,
.input-group > .form-select {
    border-radius: 0 !important;
    margin-bottom: 0 !important;
}
.input-group > .btn {
    border-radius: 0 !important;
}
.input-group > .input-group-text {
    margin-bottom: 0 !important;
    border-radius: 0 !important;
}
.input-group > :first-child {
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
}
.input-group > :last-child {
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

/* Header Contrast */
.card-header.bg-primary h4 {
    color: #ffffff !important;
}


/* Custom Utilities */
.text-justify {
    text-align: justify;
}

/* Toast Overrides */
.toast-container {
    z-index: 5000 !important;
}

.toast {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Mobile Polish */
@media (max-width: 640px) {
    .card-body {
        padding: 1rem;
    }

    h1,
    .display-4 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    .form-section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    .experience-item .row>div {
        margin-bottom: 0.5rem;
    }

    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}