/* DataForge Canada Custom Styles */

:root {
    --primary-color: #4A4A68;
    --secondary-color: #3D3D56;
    --accent-color: #F4C430;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --success-color: #28a745;
    --danger-color: #dc3545;
}

/* Global Styles */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

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

.btn-accent {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #333;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    /* CLS optimization for buttons */
    transform: translateZ(0); /* Force hardware acceleration */
    will-change: transform; /* Optimize for smooth animations */
    backface-visibility: hidden; /* Prevent flickering */
}

.btn-accent:hover {
    background-color: #E6B429;
    border-color: #E6B429;
    color: #333;
}

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

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

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

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

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

/* Navigation */
.navbar {
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    min-height: 80px;
    max-height: 80px;
    overflow: visible;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Logo Styles */
.logo-img {
    height: 80px;
    width: auto;
    transition: all 0.3s ease;
    position: relative;
    top: 8px;
}


/* Mobile Logo */
@media (max-width: 991.98px) {
    .logo-img {
        height: 60px;
        top: 0;
    }
    
    .navbar {
        min-height: 70px;
        max-height: none;
        padding: 8px 0;
    }
}

.logo-img-footer {
    height: 35px;
    width: auto;
    background: white;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar-nav {
    align-items: center;
}

.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 8px;
    display: flex;
    align-items: center;
    min-height: 80px;
}

/* Dropdown Menu Styling */
.dropdown-menu {
    background: linear-gradient(135deg, rgba(74, 74, 104, 0.98), rgba(61, 61, 86, 0.98));
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-top: 0;
    padding: 0;
}

.dropdown-item {
    color: white;
    padding: 12px 20px;
    font-weight: 500;
}

.dropdown-item:focus,
.dropdown-item:active {
    background-color: rgba(244, 196, 48, 0.2);
    color: #F4C430;
}

.dropdown-toggle::after {
    margin-left: 6px;
}

/* Mobile Navigation Styles */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: var(--primary-color);
        border-radius: 10px;
        margin-top: 10px;
        padding: 20px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    }
    
    .navbar-nav {
        align-items: stretch;
    }
    
    .navbar-nav .nav-item {
        display: block;
    }
    
    .navbar-nav .nav-link {
        margin: 0;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 1.1rem;
        display: block;
        color: rgba(255, 255, 255, 0.9) !important;
        min-height: auto;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    .dropdown-menu {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .dropdown-item {
        color: rgba(255, 255, 255, 0.8);
        padding: 12px 20px 12px 40px;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .dropdown-item:focus,
    .dropdown-item:active {
        background-color: rgba(244, 196, 48, 0.2);
        color: #F4C430;
    }
    
    .navbar-toggler {
        border: 2px solid rgba(255, 255, 255, 0.5);
        padding: 8px 12px;
        border-radius: 8px;
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
    }
    
    .navbar-toggler-icon {
        width: 24px;
        height: 24px;
    }
}

/* Hero Section - CLS Optimized */
.hero-section {
    background: linear-gradient(135deg, rgba(74, 74, 104, 0.95), rgba(61, 61, 86, 0.95)) !important;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center top;
    background-attachment: scroll !important;
    position: relative;
    /* Use dynamic viewport height for better mobile experience */
    height: 100vh; /* Fallback for older browsers */
    height: 100dvh; /* Dynamic viewport height - excludes mobile URL bars */
    display: flex;
    align-items: center;
    padding-top: 80px;
    z-index: 1;
    isolation: isolate;
    contain: layout style; /* CSS containment to prevent layout shifts */
}

/* Fallback support check for dynamic viewport units */
@supports not (height: 100dvh) {
    .hero-section {
        height: 100vh;
        min-height: 600px;
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Explicit width instead of right: 0 */
    height: 100%; /* Explicit height instead of bottom: 0 */
    background: rgba(0, 0, 0, 0.3);
    will-change: auto; /* Optimize for layout stability */
    content-visibility: auto; /* Improve rendering performance */
}

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

.cta-card {
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Reserve space to prevent layout shifts during interactions */
    transform: translateZ(0); /* Force hardware acceleration and prevent reflows */
    will-change: transform; /* Hint to browser for optimization */
}


/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.flash-messages .alert {
    margin-bottom: 10px;
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Cost savings banner - permanent element that shouldn't auto-hide */
.cost-savings-banner {
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.2);
}

/* Testimonials */
#testimonials {
    background: #f8f9fa !important;
    position: relative;
    z-index: 10;
    isolation: isolate;
    overflow: hidden;
}

/* Disable vertical movement in testimonial carousel */
#testimonialCarousel .carousel-item,
#testimonialCarousel .carousel-item-next,
#testimonialCarousel .carousel-item-prev,
#testimonialCarousel .carousel-item.active {
    transform: translateX(0) !important;
}

/* Set fixed height for carousel to prevent size changes */
#testimonialCarousel .carousel-inner {
    min-height: 400px;
}

.testimonial-card {
    border-radius: 15px;
    border: none;
    background: white !important;
    position: relative;
    z-index: 11;
    transform: none !important;
    animation: none !important;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: none !important;
}

.testimonial-card .blockquote {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.testimonial-card .blockquote p {
    font-size: clamp(1rem, 4vw, 1.25rem);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
}

.stars {
    font-size: clamp(1rem, 3vw, 1.2rem);
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    color: var(--primary-color);
    z-index: 2;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    opacity: 0.8;
}

/* Hide carousel controls on mobile to prevent text overlap */
@media (max-width: 768px) {
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
    
    /* Hide indicators on mobile to prevent text overlap */
    .carousel-indicators {
        display: none !important;
    }
    
    /* Remove any focus outlines or touch indicators from carousel */
    #testimonialCarousel,
    #testimonialCarousel *,
    .carousel-inner,
    .carousel-item {
        outline: none !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    /* Override any Bootstrap carousel focus styles on mobile */
    .carousel:focus,
    .carousel *:focus {
        outline: none !important;
        box-shadow: none !important;
    }
    
    /* Add extra padding to testimonial cards on mobile to account for no indicators */
    .testimonial-card {
        margin-bottom: 2rem;
        outline: none !important;
    }
}

.carousel-indicators button {
    background-color: var(--primary-color);
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Services Section */
.service-card {
    background: linear-gradient(135deg, rgba(74, 74, 104, 0.95), rgba(61, 61, 86, 0.95));
    color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.service-card h5, .service-card h4 {
    color: #F4C430 !important;
}

.service-card i {
    color: #F4C430 !important;
}


.services-visual {
    background: linear-gradient(135deg, rgba(74, 74, 104, 0.95), rgba(61, 61, 86, 0.95));
    color: white;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.services-visual h4 {
    color: #F4C430 !important;
}

.services-visual i {
    color: #F4C430 !important;
}


/* About Section */
.about-card {
    background: linear-gradient(135deg, rgba(74, 74, 104, 0.95), rgba(61, 61, 86, 0.95));
    color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.about-card h4 {
    color: #F4C430 !important;
}

.about-card i {
    color: #F4C430 !important;
}


/* Global Card Styling - applies to all pages */
.card:not(.testimonial-card) {
    background: linear-gradient(135deg, rgba(74, 74, 104, 0.95), rgba(61, 61, 86, 0.95)) !important;
    color: white !important;
}

.card:not(.testimonial-card) h3,
.card:not(.testimonial-card) h4,
.card:not(.testimonial-card) h5 {
    color: #F4C430 !important;
}

.card:not(.testimonial-card) i {
    color: #F4C430 !important;
}

.card:not(.testimonial-card) .bg-light {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.card:not(.testimonial-card) .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.card:not(.testimonial-card) .text-dark {
    color: white !important;
}

.card:not(.testimonial-card) a.text-dark {
    color: white !important;
}

.card:not(.testimonial-card) a.text-dark:hover {
    color: #F4C430 !important;
}

.card:not(.testimonial-card) .btn-outline-primary {
    background-color: #F4C430 !important;
    border-color: #F4C430 !important;
    color: #333 !important;
}

.card:not(.testimonial-card) .btn-outline-primary:hover {
    background-color: #E6B429 !important;
    border-color: #E6B429 !important;
    color: #333 !important;
}

.card:not(.testimonial-card) .card-header {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #F4C430 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.card:not(.testimonial-card) .badge.bg-primary {
    background-color: #F4C430 !important;
    color: #333 !important;
}

/* Team Cards - apply consistent styling */
.team-card {
    background: linear-gradient(135deg, rgba(74, 74, 104, 0.95), rgba(61, 61, 86, 0.95)) !important;
    color: white !important;
}

.team-card h4 {
    color: #F4C430 !important;
}

.team-card .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Client Portfolio */
.client-logo {
    border-radius: 10px;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* Software Partners */
.partner-logo {
    border-radius: 10px;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}


.partner-img {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.enterprise-logo-text {
    padding: 10px 0;
}

.enterprise-logo-text h4 {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.enterprise-logo-text small {
    font-size: 0.8rem;
}

/* Contact Section */
.contact-form-card,
.contact-info-card {
    border-radius: 15px;
    border: none;
}

.contact-info-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.contact-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 1rem;
}

.contact-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Blog Visual */
.blog-visual {
    background: linear-gradient(135deg, rgba(74, 74, 104, 0.95), rgba(61, 61, 86, 0.95));
    color: white;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.blog-visual h4 {
    color: #F4C430 !important;
}

.blog-visual i {
    color: #F4C430 !important;
}


/* Footer - Only apply to main site footer, not blog post footers */
footer.bg-dark {
    background: linear-gradient(135deg, var(--dark-gray), #2c2c2c) !important;
}

.newsletter-form .input-group {
    border-radius: 8px;
    overflow: hidden;
}

.newsletter-form .form-control {
    border: none;
    border-radius: 0;
}

.newsletter-form .btn {
    border-radius: 0;
    border: none;
    padding: 12px 20px;
}

/* Responsive Design - CLS Optimized */
@media (max-width: 768px) {
    .hero-section {
        padding: 130px 0 80px;
        height: auto; /* Allow section to grow with content */
        min-height: 100vh; /* Minimum height but can expand */
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    /* Add more spacing between hero and testimonials on mobile */
    #testimonials {
        margin-top: 5rem;
        padding-top: 4rem !important;
    }
    
    .cta-card {
        margin-bottom: 2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .flash-messages {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    /* Mobile-friendly buttons */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .btn-lg {
        min-height: 48px;
        padding: 14px 24px;
        font-size: 1.1rem;
    }
    
    /* Mobile touch targets */
    .nav-link, .btn, .form-control {
        min-height: 44px;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
        min-height: 50px;
    }
    
    .cta-card {
        padding: 1.5rem !important;
    }
    
    /* Extra spacing for testimonials on small screens */
    #testimonials {
        margin-top: 6rem;
        padding-top: 5rem !important;
    }
}

/* iPhone SE and similar very small screens */
@media (max-width: 400px) {
    .hero-section {
        padding-top: 150px !important;
        padding-bottom: 50px !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    .hero-section .row {
        align-items: flex-start !important;
        padding-top: 2rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem !important;
        line-height: 1.3;
        margin-top: 1rem;
    }
    
    .hero-content .lead {
        font-size: 1rem !important;
        margin-bottom: 2rem !important;
    }
    
    .cta-card h4 {
        font-size: 1.25rem !important;
    }
    
    .cta-card p {
        font-size: 0.95rem !important;
    }
    
    /* Ensure testimonials section has enough space */
    #testimonials {
        margin-top: 10rem;
        padding-top: 6rem !important;
    }
    
    .testimonial-card {
        padding: 1.5rem !important;
        margin: 0 0.5rem;
    }
    
    .testimonial-card .blockquote p {
        font-size: 1rem !important;
        line-height: 1.8 !important;
    }
    
    .testimonial-card .stars {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .testimonial-author {
        font-size: 0.9rem !important;
    }
    
    /* Improve carousel controls for mobile */
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 35px;
        height: 35px;
    }
    
    .carousel-indicators {
        margin-bottom: 0;
    }
    
    /* Extra small screen navigation */
    .navbar-nav .nav-link {
        padding: 18px 20px;
        font-size: 1.2rem;
    }
    
    .navbar-toggler {
        padding: 10px 14px;
    }
    
    /* Ensure all interactive elements are touch-friendly */
    a, button, .btn, .form-control, .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Section Spacing */
section {
    scroll-margin-top: 80px;
}

/* Mobile section spacing */
@media (max-width: 991.98px) {
    section {
        scroll-margin-top: 70px;
    }
    
    /* Ensure page content doesn't get cut off by navbar */
    .main-content,
    .services-hero,
    .about-hero,
    .pricing-hero,
    .blog-hero {
        padding-top: 90px;
        margin-top: -20px;
    }
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* Team Section */
.team-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.team-img {
    width: 100%;
    height: auto;
    border: 4px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.team-photo {
    position: relative;
    display: inline-block;
}

/* About Page Specific */
.about-hero {
    background: linear-gradient(135deg, rgba(90, 79, 207, 0.1), rgba(255, 149, 0, 0.1));
}

.about-content {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Utility Classes */
.shadow-lg-custom {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1) !important;
}

.border-radius-lg {
    border-radius: 15px !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
