/* Custom CM Consultants Styles */
:root {
    --primary-blue: #1e40af;
    --secondary-navy: #0f172a;
    --accent-blue: #3b82f6;
    --light-gray: #f8fafc;
    --text-gray: #374151;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-gray);
    overflow-x: hidden;
}

/* Navigation Styles */
.navbar-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-navy));
    box-shadow: 0 2px 20px rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    color: white !important;
}

.navbar-brand img {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
    border-radius: 50%;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    color: white !important;
    font-weight: 500;
    margin: 0 10px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #bfdbfe !important;
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: white;
    transition: all 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
}

.whatsapp-btn {
    background: #25d366 !important;
    color: white !important;
    border: none;
    border-radius: 25px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.whatsapp-btn:hover {
    background: #20ba5a !important;
    color: white !important;
    transform: scale(1.05);
}

/* Hero Carousel */
.hero-carousel {
    height: 70vh;
    margin-top: 76px;
    overflow: hidden;
}

.carousel-item {
    height: 70vh;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.carousel-item-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.carousel-item .w-100 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
}

.carousel-item video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
}

.carousel-item-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.carousel-content {
    z-index: 2;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    color: white;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-size: 100%, 100%;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    width: 3rem;
    height: 3rem;
}

.carousel-indicators {
    bottom: 20px;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background-color: transparent;
    opacity: 0.5;
}

.carousel-indicators .active {
    opacity: 1;
    background-color: white;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
    border-radius: 2px;
}

/* Sector Cards */
.sector-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    /* Ensure visibility by default */
    opacity: 1 !important;
    transform: none !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Ensure consistent sector card spacing */
#core-sectors .sector-card {
    margin-bottom: 0 !important;
    height: 100% !important;
}

#core-sectors .col-lg-4,
#core-sectors .col-md-6 {
    margin-bottom: 1.5rem !important;
}

.sector-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.2);
    border-color: var(--accent-blue);
    text-decoration: none;
    color: inherit;
}

.sector-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.sector-card:hover .sector-icon {
    transform: scale(1.1);
}

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

/* Vision Section */
.vision-section {
    background: linear-gradient(135deg, var(--light-gray), #e2e8f0);
}

.vision-content {
    background: white;
    padding: 3rem;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    max-width: 100%;
}

/* Ensure vision section matches core sectors section styling */
.vision-section .section-title {
    margin-bottom: 3rem !important;
}

.vision-section .row {
    margin-bottom: 2rem !important;
}

.vision-section .col-md-6,
.vision-section .col-md-4 {
    padding: 0 15px !important;
}

/* Service Cards */
.service-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.15);
}

.service-image {
    height: 200px;
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Client Cards */
.client-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.client-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.15);
}

.client-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--light-gray);
    color: var(--primary-blue);
}

/* Gallery Items */
.gallery-item {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

/* Gallery Tab System */
.gallery-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.gallery-content.active {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
}

/* Smooth transitions for gallery items */
.gallery-content .gallery-item {
    transition: all 0.5s ease;
}

.gallery-content.active .gallery-item {
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Gallery Tab Buttons */
.gallery-tab-btn {
    transition: all 0.3s ease;
    border-radius: 25px;
    padding: 10px 24px;
    font-weight: 500;
}

.gallery-tab-btn.active {
    background: var(--primary-blue) !important;
    color: white !important;
    border-color: var(--primary-blue) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.gallery-tab-btn:not(.active) {
    background: transparent !important;
    color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
}

.gallery-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.2);
}

.gallery-tab-btn:not(.active):hover {
    background: var(--primary-blue) !important;
    color: white !important;
}

/* Gallery Tab Button Styling */
#photosTab, #videosTab {
    transition: all 0.3s ease;
    border-radius: 25px;
    padding: 10px 24px;
    font-weight: 500;
    border: 2px solid var(--primary-blue);
}

#photosTab:hover, #videosTab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.2);
}

/* Active tab styling */
#photosTab.btn-primary, #videosTab.btn-primary {
    background: var(--primary-blue) !important;
    color: white !important;
    border-color: var(--primary-blue) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

/* Inactive tab styling */
#photosTab.btn-outline-primary, #videosTab.btn-outline-primary {
    background: transparent !important;
    color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
}

/* Gallery Content Transitions */
#photosContent, #videosContent {
    transition: all 0.5s ease;
}

/* Gallery Items Animation */
.gallery-item {
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Contact Form */
.contact-form {
    background: white;
    padding: 3rem;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.form-control {
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Buttons */
.btn-primary-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

.btn-primary-gradient:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    border-radius: 25px;
    padding: 8px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
}

/* Footer */
.footer-gradient {
    background: linear-gradient(135deg, var(--secondary-navy), var(--primary-blue));
}

.cert-logo {
    width: 100px;
    height: 80px;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.cert-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cert-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 4px;
}

.cert-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-blue);
    text-align: center;
    line-height: 1.2;
}

/* Main Certifications Section */
.certifications-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.cert-logo-main {
    background: white;
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid #e5e7eb;
}

.cert-logo-main:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-blue);
}

.cert-img-main {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.cert-title {
    color: var(--primary-blue);
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.cert-description {
    color: var(--text-gray);
    font-size: 0.75rem;
    margin-bottom: 0;
    line-height: 1.3;
}

.additional-cert {
    background: white;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid #f1f5f9;
}

.additional-cert:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--accent-blue);
}

.additional-cert h6 {
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 5px;
}

.additional-cert small {
    font-size: 0.75rem;
    color: var(--text-gray);
}

/* Fallback Icons for Certification Logos */
.cert-fallback {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.cert-fallback-small {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fallback: Ensure content is visible even if JavaScript fails */
.sector-card,
.service-card,
.client-card,
.section-title,
.vision-content {
    opacity: 1 !important;
    transform: none !important;
}

/* Specific rule for Core Sectors Section */
section:has(.sector-card) {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure all sections are visible */
section {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure all content within sections is visible */
section * {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Only apply fade-in animation when JavaScript is working */
.js-loaded .fade-in {
    opacity: 0;
    transform: translateY(30px);
}

.js-loaded .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Override any Bootstrap or other CSS that might hide content */
.py-5, .container, .row, .col-* {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Specific override for Core Sectors Section */
section:has(h2:contains("Core Sectors")) {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Alternative selector for Core Sectors Section */
section:has(.sector-card) {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Target Core Sectors Section specifically */
section h2.section-title:contains("Core Sectors"),
section:has(h2.section-title:contains("Core Sectors")) {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure all sector cards are visible */
.sector-card {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Specific rule for Core Sectors Section by ID */
#core-sectors {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

#core-sectors * {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure consistent section spacing and alignment */
#core-sectors,
.vision-section {
    padding: 3rem 0 !important;
}

#core-sectors .container,
.vision-section .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
}

/* Ensure consistent row spacing */
#core-sectors .row,
.vision-section .row {
    margin: 0 !important;
}

/* Ensure consistent column spacing */
#core-sectors .col-lg-12,
.vision-section .col-lg-12 {
    padding: 0 15px !important;
}

/* Force visibility for all content in case of JavaScript errors */
body * {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Only apply fade-in when JavaScript is working and elements have the visible class */
.js-loaded .fade-in:not(.visible) {
    opacity: 0;
    transform: translateY(30px);
}

/* Ensure all content is visible by default */
* {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Override fade-in opacity only when JavaScript is working and elements are properly animated */
.js-loaded .fade-in.visible {
    opacity: 1 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-carousel {
        height: 50vh;
        margin-top: 70px;
    }
    
    .carousel-item-bg {
        height: 50vh;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .display-3 {
        font-size: 2.5rem;
    }
    
    .vision-content {
        padding: 2rem;
    }
    
    .contact-form {
        padding: 2rem;
    }
    
    .navbar-nav {
        text-align: center;
        margin-top: 1rem;
    }
    
    .whatsapp-btn {
        margin-top: 1rem;
    }
    
    /* Ensure consistent mobile spacing */
    #core-sectors,
    .vision-section {
        padding: 2rem 0 !important;
    }
    
    #core-sectors .container,
    .vision-section .container {
        padding: 0 15px !important;
    }
    
    /* Gallery tabs on mobile */
    .gallery-tab-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        margin: 0 0.5rem 0.5rem 0;
    }
    
    .gallery-content {
        padding: 2rem 0 !important;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .display-3 {
        font-size: 2rem;
    }
    
    .sector-card,
    .service-card,
    .client-card {
        padding: 1.5rem;
    }
    
    .vision-content,
    .contact-form {
        padding: 1.5rem;
    }
    
    /* Ensure consistent small screen spacing */
    #core-sectors,
    .vision-section {
        padding: 1.5rem 0 !important;
    }
    
    #core-sectors .sector-card {
        padding: 1.5rem !important;
    }
    
    .vision-content {
        padding: 1.5rem !important;
        border-radius: 15px !important;
    }
}

/* Custom Utilities */
.text-shadow-lg {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.text-shadow-md {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

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

/* Loading animation for images */
img {
    transition: opacity 0.3s ease;
}

img:not([src]) {
    opacity: 0;
}

/* Ensure perfect alignment between sections */
#core-sectors,
.vision-section {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

#core-sectors .container,
.vision-section .container {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 15px !important;
}

/* Ensure consistent grid alignment */
#core-sectors .row,
.vision-section .row {
    width: 100% !important;
    margin: 0 !important;
}

#core-sectors .col-lg-12,
.vision-section .col-lg-12 {
    width: 100% !important;
    padding: 0 !important;
}

/* Ensure Bootstrap grid consistency */
#core-sectors .row > [class*="col-"],
.vision-section .row > [class*="col-"] {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Ensure consistent card heights */
#core-sectors .sector-card,
.vision-section .service-card {
    height: 100% !important;
    min-height: 300px !important;
}

/* Ensure consistent spacing between elements */
#core-sectors .sector-card + .sector-card,
.vision-section .service-card + .service-card {
    margin-top: 0 !important;
}

/* Ensure consistent margins for section titles */
#core-sectors .section-title,
.vision-section .section-title {
    margin-bottom: 3rem !important;
    margin-top: 0 !important;
}