:root {
    --primary-color: #6366f1;
    --secondary-color: #ec4899;
    --dark-bg: #0f172a;
    --dark-surface: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-text: linear-gradient(135deg, #c084fc 0%, #6366f1 100%);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-main);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Sinhala Font Support */
:lang(si) {
    font-family: 'Noto Sans Sinhala', 'Outfit', sans-serif;
}

/* Global Overrides for Bootstrap */
.text-muted {
    color: var(--text-muted) !important;
}

.text-dark {
    color: var(--dark-bg) !important;
}

/* Ensure Cards inherit text color or are explicitly light */
.card {
    color: var(--text-main);
    background-color: var(--dark-surface);
    /* Default to dark surface if not specified */
}

/* Navbar */
#mainNav {
    padding-top: 1rem;
    padding-bottom: 1rem;
    transition: background-color 0.3s ease-in-out, padding 0.3s ease-in-out;
    background-color: transparent;
    backdrop-filter: blur(10px);
}

#mainNav.navbar-scrolled {
    background-color: rgba(15, 23, 42, 0.9);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#mainNav .navbar-brand {
    color: #fff;
}

.text-primary-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Fallback for browsers that don't support text fill color */
    color: var(--primary-color);
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    transition: color 0.3s;
}

#mainNav .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #fff !important;
}

#mainNav .nav-link:hover,
.nav-link.active {
    color: #fff !important;
}

/* Icon Visibility */
.bi {
    color: inherit;
    /* Ensure icons take parent color by default */
}

/* Buttons */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.23);
    background: var(--gradient-primary);
    /* Keep gradient */
}

/* Hero Section */
header.masthead {
    padding-top: 9.5rem;
    padding-bottom: 5rem;
    position: relative;
    overflow: hidden;
}

/* Background blob effect */
header.masthead::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
    z-index: -1;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-circle-bg {
    position: absolute;
    width: 500px;
    height: 500px;
    background: var(--gradient-primary);
    filter: blur(150px);
    opacity: 0.2;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.hero-img {
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.hero-img:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

/* Animations */
.animate-fade-in-up {
    animation: fadeInUp 1s ease-out;
}

.animate-fade-in {
    animation: fadeIn 1.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Sections */
.bg-dark-surface {
    background-color: var(--dark-surface);
}

/* Service Cards */
.service-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
    border-color: rgba(99, 102, 241, 0.5);
}

.card-icon-wrapper {
    transition: transform 0.3s;
}

.service-card:hover .card-icon-wrapper {
    transform: scale(1.1);
}

/* Form Overrides */
.form-control:focus {
    background-color: var(--dark-bg);
    color: #fff;
    border-color: #6366f1;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

/* Animations Scroll */
.animate-fade-in-right {
    animation: fadeInRight 1s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 1s ease-out;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}