@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #5D50E8; /* Slightly lighter purple for better readability */
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary: #0EA5E9;
    --accent: #F97316;
    --dark: #1E293B;
    --light: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --border-radius: 0.5rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--gray-800);
    background-color: var(--gray-100);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover, .btn-link:hover {
    color: var(--primary-dark);
    text-decoration: none; /* Changed from underline to none */
}

.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.btn-primary {
    color: white;
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    color: white;
    background-color: var(--primary);
}

.content {
    padding-top: 1.5rem;
}

.card {
    background-color: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

.form-control, .form-select {
    border-radius: var(--border-radius);
    border-color: var(--gray-300);
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success);
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
}

.progress {
    border-radius: 100px;
    height: 0.75rem;
    background-color: var(--gray-200);
}

.progress-bar {
    border-radius: 100px;
}

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

.bg-info {
    background-color: var(--secondary) !important;
}

.bg-warning {
    background-color: var(--warning) !important;
}

.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 100px;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.list-group-item {
    border-color: var(--gray-200);
    padding: 0.75rem 1rem;
}

.list-group-item-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.2);
}

.list-group-item-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.2);
}

.list-group-item.active {
    background-color: var(--primary);
    border-color: var(--primary);
}

.alert {
    border-radius: var(--border-radius);
    border: none;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

#blazor-error-ui {
    background: var(--warning);
    color: var(--gray-900);
    bottom: 0;
    box-shadow: var(--shadow-md);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

.sidebar {
    background-color: var(--primary);
    box-shadow: var(--shadow);
}

/* Improved sidebar styling for better contrast */
.sidebar a, .sidebar .nav-link, .sidebar span, nav a, nav span, [class*="indigo"] {
    color: white !important; /* Force white text for all sidebar links */
    font-weight: 500; /* Medium font weight for better readability */
    transition: all 0.2s ease;
}

.sidebar a:hover, .sidebar .nav-link:hover, nav a:hover, .hover\:bg-indigo-700:hover {
    background-color: rgba(255, 255, 255, 0.2) !important; /* Semi-transparent white background */
    color: white !important;
    text-decoration: none;
}

/* Active state for sidebar links */
.sidebar a.active, .sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.3) !important; /* Slightly more visible background */
    color: white !important;
    font-weight: 600; /* Slightly bolder */
}

.top-row {
    background-color: white;
    border-bottom: 1px solid var(--gray-200);
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.top-row ::deep a, .top-row ::deep .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--gray-700);
}

.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
    color: var(--primary);
    text-decoration: none; /* Changed from underline to none */
}

.top-row ::deep a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide the About link in the top-right corner only */
header a[href="/about"],
header a[href="about"],
.top-row a[href="/about"],
.top-row a[href="about"] {
    display: none !important;
}

/* Specifically target the header about link from the screenshot */
.flex.items-center.justify-end a[href="/about"] {
    display: none !important;
}

@media (max-width: 640.98px) {
    .top-row:not(.auth) {
        display: none;
    }

    .top-row.auth {
        justify-content: space-between;
    }

    .top-row ::deep a, .top-row ::deep .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth ::deep a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

/* Ensure that all text in sidebar items is visible with proper contrast */
.flex.items-center.space-x-3.p-2 {
    color: white !important;
}

/* Fix for SVG icons in the sidebar */
.sidebar svg, nav svg {
    color: white !important;
    fill: currentColor;
}

/* Ensure button text is readable on purple background */
.btn, button {
    position: relative;
    z-index: 1; /* Ensure the button text is above any background */
}

/* Improve readability for transportation options */
button[class*="bg-primary"] p,
[class*="bg-primary"] p,
[class*="text-primary"] + p,
button[class*="border-primary"] p {
    color: #1E293B !important; /* Dark gray text for better contrast */
    font-weight: 500 !important; /* Medium weight for better visibility */
}

/* Specifically target price and duration information in transportation options */
p.text-sm.text-gray-600,
p.text-xs.text-gray-500 {
    color: #1E293B !important; /* Darker text for better readability */
    font-weight: 500 !important; /* Medium weight for better visibility */
    background-color: rgba(255, 255, 255, 0.7) !important; /* Semi-transparent white background */
    padding: 2px 5px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    margin-bottom: 4px !important;
}

/* Make sure the transportation option cards have a lighter background */
button[class*="bg-primary/10"] {
    background-color: rgba(93, 80, 232, 0.05) !important; /* Lighter purple background */
    border-color: var(--primary) !important;
}

/* Ensure text in transportation option cards is readable */
button[class*="text-primary"] {
    color: var(--primary-dark) !important; /* Darker purple for better contrast */
}

/* Improve transportation option display */
.space-y-2 button {
    border: 1px solid #E2E8F0 !important;
    background-color: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    padding: 12px !important; /* Add more padding */
}

/* Highlight selected transportation option */
.space-y-2 button[class*="border-primary"] {
    border: 2px solid var(--primary) !important;
    background-color: rgba(255, 255, 255, 0.95) !important; /* Nearly white background for better contrast */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
}

/* Hover effect for transportation options */
.space-y-2 button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
}

/* Ensure headers in transportation options stand out */
.space-y-2 h4.font-semibold {
    color: var(--gray-900) !important;
    font-weight: 600 !important;
}

/* Make all score bubbles consistent */
.space-y-2 span[class*="rounded-full"],
span[class*="rounded-full"],
.px-2.py-1.text-sm.font-medium.rounded-full {
    background-color: white !important;
    border: 1px solid var(--primary) !important;
    color: var(--primary-dark) !important;
    font-weight: 600 !important;
    padding: 2px 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* Improve visibility for journey details section */
div.bg-gray-50.rounded-lg.p-4 {
    background-color: white !important;
    border: 1px solid var(--gray-200) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Make spans with font-medium stand out more */
span.font-medium {
    color: var(--gray-900) !important;
    font-weight: 600 !important;
}

/* Improve pro/con lists readability */
.bg-green-50.border-l-4.border-green-500,
.bg-red-50.border-l-4.border-red-500 {
    border-width: 3px !important; /* Reduced from 4px to 3px */
    padding: 8px 12px !important;
    border-radius: 0 6px 6px 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Enhance the visibility of pros text */
.text-green-700 {
    color: #15803d !important; /* Darker green */
    font-weight: 500 !important;
}

/* Enhance the visibility of cons text */
.text-red-700 {
    color: #b91c1c !important; /* Darker red */
    font-weight: 500 !important;
}

/* New styling for buttons to match the Advisor page */
.btn-primary,
a.btn-primary,
.btn-lg,
button[class*="bg-primary"],
a[href*="journey"],
button[href*="journey"],
a[href*="planning"],
button[href*="planning"],
.d-grid .btn {
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem !important; /* Matches rounded-md in Tailwind */
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    background-color: var(--primary) !important;
    color: white !important;
    border: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    text-decoration: none !important;
    display: inline-block !important;
    text-align: center !important;
    line-height: 1.5 !important;
}

/* Hover state for buttons */
.btn-primary:hover,
a.btn-primary:hover,
.btn-lg:hover,
button[class*="bg-primary"]:hover,
a[href*="journey"]:hover,
button[href*="journey"]:hover,
a[href*="planning"]:hover,
button[href*="planning"]:hover,
.d-grid .btn:hover {
    background-color: var(--primary-dark) !important;
    text-decoration: none !important;
    transform: translateY(0) !important; /* Remove the raise effect */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important; /* Lighter shadow */
}

/* Active state for buttons */
.btn-primary:active,
a.btn-primary:active,
.btn-lg:active,
button[class*="bg-primary"]:active,
a[href*="journey"]:active,
button[href*="journey"]:active,
a[href*="planning"]:active,
button[href*="planning"]:active,
.d-grid .btn:active {
    background-color: var(--primary-dark) !important;
    transform: translateY(1px) !important; /* Slight press effect */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important; /* Even lighter shadow when pressed */
}

/* Focus state for buttons */
.btn-primary:focus,
a.btn-primary:focus,
.btn-lg:focus,
button[class*="bg-primary"]:focus,
a[href*="journey"]:focus,
button[href*="journey"]:focus,
a[href*="planning"]:focus,
button[href*="planning"]:focus,
.d-grid .btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3) !important; /* Focus ring */
}

/* Fix for the Powered By section */
[class*="powered-by"], [class*="poweredby"], footer img, footer svg {
    position: relative;
    z-index: 10; /* Ensure logo is above any backgrounds */
    max-width: 150px; /* Limit logo size */
    background-color: white; /* Add white background to logo */
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px auto; /* Center the logo */
    display: block; /* Make it a block element */
}

/* Clear any background elements that might be covering content */
[class*="powered"], [class*="powered"] + div, footer div {
    position: relative;
    background: transparent !important; /* Remove any backgrounds */
    color: var(--gray-900) !important; /* Ensure text is dark and readable */
    text-align: center;
    font-weight: 500;
    z-index: 5;
}

/* Target the purple blobs/logos that might be hiding text */
img[src*="logo"], svg[class*="logo"], [class*="logo"], [class*="blob"],
footer img, footer svg, footer [class*="logo"] {
    max-width: 120px !important;
    max-height: 60px !important;
    opacity: 0.9 !important; /* Make slightly transparent */
    background-color: white !important; /* Add white background */
    padding: 8px !important;
    border-radius: 8px !important;
    margin: 0 auto 10px auto !important; /* Center and add margin below */
    display: block !important;
}

/* Ensure text below logos is visible */
footer p, footer div p, [class*="powered"] p {
    margin-top: 10px !important;
    color: var(--gray-900) !important;
    font-weight: 500 !important;
    text-shadow: 0 0 5px white, 0 0 10px white !important; /* Add white glow behind text */
    background-color: rgba(255, 255, 255, 0.7) !important; /* Semi-transparent white background */
    padding: 5px 10px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Remove the purple bars above headings on the About page */
.rounded-circle.bg-primary.bg-opacity-10.p-2.me-3 {
    display: none !important; /* Hide the purple circular icons completely */
}

/* Adjust the spacing for headings since the icons are now gone */
.d-flex.align-items-center.mb-3 {
    margin-bottom: 1rem !important;
}

/* Make heading text slightly larger to compensate for the missing icons */
.card-body .h4 {
    font-size: 1.25rem !important;
    margin-bottom: 0.75rem !important;
}

/* Restyle the heading section for a cleaner look without the icons */
.card-body .d-flex.align-items-center.mb-3 {
    border-bottom: 2px solid var(--gray-200) !important;
    padding-bottom: 0.75rem !important;
}

/* HOMEPAGE SPECIFIC STYLES - Make it consistent with the About page */

/* Restyle the step indicator cards on the homepage */
.card .rounded-circle.bg-primary.bg-opacity-10 {
    background-color: white !important; /* Change from purple to white */
    border: 2px solid var(--primary) !important; /* Add border instead */
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Ensure the step numbers are clearly visible */
.card .rounded-circle.bg-primary.bg-opacity-10 .h3.text-primary {
    color: var(--primary) !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    margin-top: 3px !important; /* Slight adjustment for vertical centering */
}

/* Make the step titles stand out more */
.card-body .h5 {
    color: var(--primary-dark) !important;
    font-weight: 600 !important;
    margin-top: 1rem !important;
    font-size: 1.1rem !important;
    text-align: center !important;
}

/* Ensure step description text is readable */
.card-body .text-muted {
    color: var(--gray-700) !important;
    font-weight: 500 !important;
    text-align: center !important;
}

/* Add a border to the step cards for more definition */
.card.border-0.shadow-sm.h-100.mb-3 {
    border: 1px solid var(--gray-200) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease !important;
}

/* Add a hover effect to the step cards */
.card.border-0.shadow-sm.h-100.mb-3:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1) !important;
}

/* Style the "Powered by" badges */
.badge.bg-primary.bg-opacity-10.text-primary {
    background-color: white !important;
    color: var(--primary) !important;
    font-weight: 500 !important;
    border: 1px solid var(--primary) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    margin: 0 5px !important; /* Add horizontal spacing between badges */
    display: inline-block !important; /* Make badges display inline */
}

/* Style the "Powered by" heading */
.h4.mb-4 {
    color: var(--gray-800) !important;
    text-align: center !important;
    font-weight: 600 !important;
    margin-bottom: 1.5rem !important;
}

/* Make the powered by badge container horizontal */
.d-flex.justify-content-center.align-items-center.flex-wrap.gap-3 {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important; /* Reduced gap for tighter horizontal layout */
}

/* Ensure each badge container takes minimal width */
.d-flex.justify-content-center.align-items-center.flex-wrap.gap-3 > div {
    margin: 0 5px !important;
    display: inline-block !important;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .d-flex.justify-content-center.align-items-center.flex-wrap.gap-3 {
        justify-content: center !important;
    }

    .badge.bg-primary.bg-opacity-10.text-primary {
        margin: 3px !important;
        font-size: 0.85rem !important; /* Slightly smaller font on mobile */
    }
}
