:root {
    --primary-color: #0098b3;
    --primary-dark: #007a8f;
    --primary-light: #33adca;
    --secondary-color: #00bf62;
    --secondary-dark: #00994e;
    --secondary-light: #33cc81;
    --dark-color: #0f172a;
    --light-color: #e2e8f0;
    /* Darker than default bootstrap light (#f8f9fa) */
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--dark-color);
    scroll-behavior: smooth;
}

/* Override Bootstrap bg-light */
.bg-light {
    background-color: var(--light-color) !important;
}

/* Smooth Scrolling Offset for Fixed Navbar */
html {
    scroll-padding-top: 74px;
}

/* Gradient Text */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Safari Fixes */
    display: inline-block;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    /* Fallback color */
    color: var(--primary-color);
}

/* Gradient Background */
.gradient-bg {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
    background: url('../img/background.png') no-repeat center center/cover;
    /* Safari-compatible height setup */
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 140px;
    padding-bottom: 80px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 122, 143, 0.65), rgba(0, 152, 179, 0.65));
    /* Using theme primary colors with opacity */
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Ensure row respects flexbox centering in Safari */
.hero-section .row {
    margin-left: auto;
    margin-right: auto;
}

/* Section Titles */
.section-title {
    color: var(--primary-dark);
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary-color));
    border-radius: 2px;
}

/* Content Sections */
.content-section {
    font-size: 1.1rem;
    line-height: 1.8;
}

.content-section h2 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 1rem;
}

.content-section p {
    margin-bottom: 0.5rem;
}

.content-section ul {
    list-style: none;
    padding-left: 0;
}

.content-section ul li {
    padding-left: 2rem;
    position: relative;
    margin-bottom: 0.75rem;
}

.content-section ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Horizontal Scroll for Services and Projects */
#services-container {
    display: flex;
	justify-content: center;
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 2rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* smooth scrolling on iOS */
    scrollbar-width: thin;
    /* firefox */
    cursor: grab;
    /* Indicate draggable */
}

#services-container.active {
    cursor: grabbing;
    /* Indicate active dragging */
    scroll-behavior: auto;
    /* Remove smooth scroll during drag for responsiveness */
}

/* Custom Scrollbar */
#services-container::-webkit-scrollbar {
    height: 8px;
}

#services-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#services-container::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

#services-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Service Cards in Scroll View */
#services-container .col-md-6.col-lg-3 {
    flex: 0 0 300px;
    /* Force fixed width for scrolling items */
    max-width: 300px;
    width: 300px;
}

/* Service Cards */
.service-card {
    transition: all 0.3s ease;
    border-radius: 15px;
    height: 100%;
    user-select: none;
    /* Prevent text selection while dragging */
}

.service-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: box-shadow 0.3s ease;
    /* Removed background transition */
    color: #fff;
}

.btn-primary:hover {
    /* background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));  Removed hover gradient change */
    /* transform: translateY(-2px); Removed animation */

    color: #fff !important;
    /* Force white text */
}

.btn-danger {
    border-radius: 8px;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(2, 132, 199, 0.25);
}

/* Navbar */
.navbar {
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    align-items: center;
}

.navbar-collapse {
    align-items: center;
}

.navbar.scrolled {
    background-color: #fff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.navbar-brand img {
    height: 48px;
    width: auto;
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: var(--dark-color);
    transition: color 0.3s ease;
    padding: 0.5rem 1rem !important;
}

.nav-link-main {
    font-weight: 500;
    font-size: large;
    color: var(--dark-color);
    transition: color 0.3s ease;
    padding: 0.5rem 1rem !important;
    text-decoration: none;
}

.nav-link-main:hover {
    color: var(--primary-color) !important;
}

/* Sidebar Active State */
.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(0, 152, 179, 0.05);
    /* Subtle background tint */
    border-right: 3px solid var(--primary-color);
}


/* Footer */
footer a:hover {
    color: #fff !important;
    text-decoration: underline !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-section h1 {
        font-size: 2.5rem !important;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.section-with-bg {
    position: relative;
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    /* Force stacking context for mobile rendering layers */
    z-index: 1;
}

.section-with-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.65);
    z-index: -1;
    /* Mobile-specific rendering fixes */
    pointer-events: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.section-with-bg.bg-light::before {
    display: none;
}

/* Quill Editor Customizations */
.ql-snow .ql-picker.ql-size {
    width: 80px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
    content: attr(data-value) !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12px"]::before {
    font-size: 12px;
}

.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before {
    font-size: 14px;
}

.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16px"]::before {
    font-size: 16px;
}

.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18px"]::before {
    font-size: 18px;
}

.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20px"]::before {
    font-size: 20px;
}

.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24px"]::before {
    font-size: 24px;
}

.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="32px"]::before {
    font-size: 32px;
}

.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="48px"]::before {
    font-size: 48px;
}