:root {
    --primary-color: #38BDF8;
    /* Light Sky Blue for better contrast on dark */
    --primary-dark: #0EA5E9;
    --accent-color: #60A5FA;
    --secondary-color: #94A3B8;
    --dark-color: #FFFFFF;
    /* Headings become white */
    --light-bg: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.1);
    /* More transparent for dark mode */
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #E2E8F0;
    /* Off-white for body text */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

html,
body {
    font-family: var(--font-body);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.7;
    background-color: #0B1120;
    /* Dark Fallback */
    background-image: linear-gradient(rgba(11, 17, 32, 0.85), rgba(11, 17, 32, 0.85)), url('../images/background-pattern.png');
    /* Dark overlay */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--dark-color);
    font-weight: 700;
}

/* Glassmorphism Utility */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    color: var(--text-color);
}

/* Navbar */
.navbar {
    padding: 1.2rem 0;
    transition: all 0.3s ease;
    background-color: rgba(15, 23, 42, 0.6);
    /* Dark semi-transparent */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 15px auto;
    width: 90%;
    border-radius: 50px;
}

.navbar.scrolled {
    background-color: rgba(15, 23, 42, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 0.8rem 0;
}

/* Ensure Logo is visible */
.navbar-brand img {
    height: 50px;
    filter: brightness(0) invert(1);
    /* Make logo white if it is black */
}

.nav-link {
    font-weight: 600;
    color: #E2E8F0 !important;
    /* White text */
    margin: 0 0.8rem;
    position: relative;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

.nav-link::after {
    display: none;
}

/* Primary Button */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #0B1120;
    /* Dark text on bright button */
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
    transition: all 0.3s ease;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(56, 189, 248, 0.35);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-width: 2px;
    font-weight: 600;
    border-radius: 50px;
    padding: 0.6rem 1.6rem;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #0B1120;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(56, 189, 248, 0.15);
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delay {
    animation: float 5s ease-in-out infinite;
    animation-delay: 1s;
}

/* General Card Styles - now using glassmorphism */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    color: var(--text-color);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

/* Service Cards */
.service-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: rgba(255, 255, 255, 0.05);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3) !important;
    background: rgba(255, 255, 255, 0.1);
}

.service-card .icon-circle {
    transition: all 0.3s ease;
}

.service-card:hover .icon-circle {
    transform: scale(1.1);
    background-color: var(--accent-color) !important;
    color: white !important;
}

.service-card:hover .btn-link {
    text-decoration: underline !important;
    color: var(--primary-color);
}

/* Process Cards */
.process-card {
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

.process-card:hover {
    transform: translateY(-5px);
    border-bottom-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

/* Country Cards */
.country-card {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2) !important;
    background: rgba(255, 255, 255, 0.1);
}

.country-card img {
    transition: transform 0.3s ease;
}

.country-card:hover img {
    transform: scale(1.05);
}

/* Accordion */
.accordion-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.accordion-button {
    background: transparent;
    color: var(--text-color);
}

.accordion-button:not(.collapsed) {
    background-color: rgba(56, 189, 248, 0.1);
    /* Sky blue tint */
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(56, 189, 248, 0.5);
}

.accordion-button::after {
    filter: invert(1);
    /* Make accordion icon white */
}

.accordion-body {
    background: transparent;
    color: var(--text-color);
}

/* Footer */
.bg-dark {
    background-color: #020617 !important;
    /* Very dark footer */
    /* backdrop-filter: blur(20px); */
    /* opacity: 0.95; */
}

footer a:hover {
    opacity: 1;
    color: var(--primary-color) !important;
    padding-left: 5px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-3px);
    display: inline-block;
}

/* Misc */
.opacity-75 {
    opacity: 0.75;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-10 {
    opacity: 0.1;
}

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

.text-secondary {
    color: #94A3B8 !important;
    /* Lighter secondary text for dark mode */
}

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

.bg-light {
    background-color: transparent !important;
    /* Make sections transparent to show bg */
}

section {
    position: relative;
    overflow: hidden;
    /* Allow sticky nav to work better if needed, but watch out for background */
}

/* Utility Classes */
.hover-top {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Dark Mode Overrides for Bootstrap Utilities */
.bg-white,
.card.bg-white {
    background-color: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.text-dark {
    color: #f8f9fa !important;
}

.text-muted,
.text-secondary {
    color: #cbd5e1 !important;
    /* Slate 300 for readability on dark */
}

.navbar-light .navbar-nav .nav-link {
    color: #E2E8F0;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary-color);
}

/* Modal Glassmorphism */
.modal-content {
    background: rgba(15, 23, 42, 0.85);
    /* Darker glass for modal */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    border-radius: 20px;
}

.modal-header,
.modal-footer {
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    /* Make close button white */
}

/* Form Inputs in Glass Modal */
.form-control,
.form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25);
    color: white;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Button Squares */
.btn-lg-square {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix for Floating Labels White Background Overlay */
.form-floating>.form-control:focus~label::after,
.form-floating>.form-control:not(:placeholder-shown)~label::after,
.form-floating>.form-select~label::after {
    background-color: transparent !important;
}

/* Remove default white background on autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(15, 23, 42, 0.9) inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Fix for Country Page White Backgrounds */
.list-group-item {
    background-color: transparent !important;
    color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header.bg-white {
    background-color: transparent !important;
}

/* Ensure strong text inside lists is visible */
.list-group-item strong {
    color: #fff;
}

/* Fix for University Cards White Background */
.bg-white,
.card.bg-white,
div[class*="bg-white"] {
    background-color: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}


/* Dark Mode Colors for Icons */
.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: #4ade80 !important;
}

/* Lighter Green */
.text-warning {
    color: #facc15 !important;
}

/* Lighter Yellow */
.text-info {
    color: #22d3ee !important;
}

/* Lighter Cyan */

/* Make icon backgrounds visible */
.benefit-icon {
    background: rgba(255, 255, 255, 0.1) !important;
    /* Unified glass background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.benefit-icon i {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    color: inherit;
    /* Ensure it takes the text-primary color */
}

/* Allow specific tints if needed checking for bg-opacity-10 combination or direct classes */
.bg-primary.bg-opacity-10 {
    background-color: rgba(56, 189, 248, 0.15) !important;
}

.bg-success.bg-opacity-10 {
    background-color: rgba(74, 222, 128, 0.15) !important;
}

.bg-warning.bg-opacity-10 {
    background-color: rgba(250, 204, 21, 0.15) !important;
}

.bg-info.bg-opacity-10 {
    background-color: rgba(34, 211, 238, 0.15) !important;
}

/* Wave Divider */
.wave-divider svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: rgba(15, 23, 42, 0.5);
    /* Dark wave */
}

/* Country Page Redesign */
.country-hero {
    position: relative;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 80px 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(2, 6, 23, 0.7), rgba(15, 23, 42, 0.9));
    z-index: 1;
}

.country-hero .container {
    position: relative;
    z-index: 2;
}

.info-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    background: rgba(30, 41, 59, 0.7);
    /* Dark card base */
    backdrop-filter: blur(10px);
    color: white;
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3) !important;
}

.benefit-card {
    height: 100%;
}

.benefit-icon {
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(30, 58, 138, 0.1);
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.info-card:hover .benefit-icon {
    background: var(--primary-color);
    color: #0B1120;
}

/* Decorative Elements */
.shape-bg {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

/* Navbar Hover Dropdown */
@media (min-width: 992px) {
    .dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
        animation: fadeIn 0.3s ease;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dropdown-item {
        color: var(--text-color);
    }

    .dropdown-item:hover {
        background-color: var(--primary-color);
        color: #0B1120;
    }
}

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

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

/* Mobile Responsiveness */
@media (max-width: 991px) {

    /* Navbar */
    .navbar {
        width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 0.8rem 0;
        background-color: rgba(15, 23, 42, 0.95);
        /* More solid on mobile */
    }

    .navbar-collapse {
        background-color: transparent;
        /* Integrated */
        backdrop-filter: none;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        margin-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1rem;
    }

    .nav-link {
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .navbar-toggler {
        border: none;
        padding: 0;
        filter: invert(1);
        /* Make hamburger white */
    }

    .navbar-toggler:focus {
        box-shadow: none;
    }

    /* Mobile Dropdown */
    .dropdown-menu {
        background-color: transparent;
        border: none;
        padding-left: 1.5rem;
    }

    .dropdown-item {
        color: rgba(255, 255, 255, 0.8);
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: transparent;
        color: var(--primary-color);
    }

    /* Hero Section */
    .country-hero {
        min-height: 400px;
        padding: 60px 0;
        margin-top: 56px !important;
    }

    h1.display-3 {
        font-size: 2.5rem;
    }

    .lead {
        font-size: 1rem;
    }

    /* Spacing */
    section {
        padding: 60px 0;
    }

    .card {
        margin-bottom: 15px;
    }

    /* Modal */
    .modal-dialog {
        margin: 10px;
    }

    .modal-content {
        background-color: var(--light-bg);
        color: var(--text-color);
    }

    .modal-body {
        padding: 1.5rem;
    }

    .display-6 {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    h1.display-3 {
        font-size: 2rem;
    }

    .btn-lg {
        width: 100%;
        margin-bottom: 10px;
    }
}