/* =========================================
   1. GLOBAL RESET & CORE LAYOUT
   ========================================= */

:root {
    --bs-primary: #000000;
    --bs-secondary: #FF0000;
    --bs-white: #fff;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden; /* Prevents horizontal scrolling issues */
    font-family: 'Inter', sans-serif;
    color: #888;
    background: var(--bs-white);
    font-weight: 400;
}

/* Force full width on all main containers */
.container, 
.wrapper, 
.site-content, 
.main-content, 
#content,
.container-fluid {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

p {
    font-size: 16px;
    line-height: 1.7;
}

/* =========================================
   2. TYPOGRAPHY
   ========================================= */

/* Enforce 'Inter' font on all headings and text */
h1, h2, h3, h4, h5, h6, 
.h1, .h2, .h3, .h4, .h5, .h6, 
.display-1, .display-2, .display-3, 
.navbar-brand, .carousel-caption,
.carousel-content h1, .carousel-content h6 {
    font-family: 'Inter', sans-serif !important;
    font-weight: 700;
}

/* Standard Heading Sizes */
h1, .h1 { font-size: 2.25rem !important; } /* ~36px */
h2, .h2 { font-size: 1.75rem !important; } /* ~28px */
h3, .h3 { font-size: 1.5rem !important; }  /* ~24px */
h4, .h4 { font-size: 1.25rem !important; } /* ~20px */
h5, .h5 { font-size: 0.9rem !important; }  /* ~18px */
h6, .h6 { font-size: 1rem !important; }    /* ~16px */

/* Display Classes (Hero/Carousel) */
.display-1 { font-size: 3rem !important; font-weight: 700; }
.display-2 { font-size: 2.5rem !important; font-weight: 700; }

.text-secondary { color: red !important; }
.text-primary { color: #000 !important; }
.bg-secondary { background-color: red !important; }

/* =========================================
   3. BUTTONS & UI ELEMENTS
   ========================================= */

.btn { font-weight: 600; transition: .5s; }

/* Primary Button (Black) */
.btn-primary {
    color: #fff !important;
    background-color: #000 !important;
    border-color: #000 !important;
}
.btn-primary:hover {
    background-color: #333 !important;
    border-color: #333 !important;
}

/* Secondary Button (Red) */
.btn-secondary {
    color: #000 !important;
    border-color: red !important;
    position: relative;
    background-color: red !important; /* Fixed override */
}
.btn-secondary:hover {
    background-color: #e60000 !important;
    border-color: #e60000 !important;
    color: #fff !important;
}

/* Square Buttons */
.btn-square { width: 38px; height: 38px; }
.btn-sm-square { width: 32px; height: 32px; }
.btn-md-square { width: 46px; height: 46px; }
.btn-lg-square { width: 58px; height: 58px; }

.btn-lg-square, .btn-md-square, .btn-sm-square, .btn-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    width: 50px;
    height: 50px;
    right: 30px;
    bottom: 30px;
    z-index: 99;
    background: red !important;
}
.back-to-top:hover { background: #000 !important; }

/* Spinner */
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}
#spinner.show {
    transition: opacity .8s ease-out, visibility linear;
    visibility: visible;
    opacity: 1;
}

/* =========================================
   4. HEADER & NAVIGATION
   ========================================= */

.topbar .top-info { letter-spacing: 1px; }
.topbar .top-link { display: flex; align-items: center; justify-content: center; }
.topbar .top-link a { margin-right: 10px; }

#note { width: 500px; overflow: hidden; }
#note small {
    display: inline-block;
    position: relative;
    animation: 5s infinite mymove;
    animation-timing-function: all;
}
@keyframes mymove { from { left: -100%; } to { left: 100%; } }

.navbar .navbar-nav { padding: 15px 0; }
.navbar .navbar-nav .nav-link {
    padding: 10px;
    color: var(--bs-white);
    font-size: 18px;
    outline: 0;
}
.navbar .navbar-nav .nav-link.active,
.navbar .navbar-nav .nav-link:hover { color: red !important; }

.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "font awesome 5 free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}
.navbar .nav-item:hover .dropdown-menu {
    transform: rotateX(0);
    visibility: visible;
    transition: .5s;
    opacity: 1;
}

.page-header {
    background: linear-gradient(rgba(0,0,0,.7),rgba(0,0,0,.7)) 0 0/cover, url(../img/carousel-1.jpg) center center/cover no-repeat;
}
.page-header .breadcrumb-item, 
.page-header .breadcrumb-item a,
.page-header .breadcrumb-item + .breadcrumb-item::before {
    font-size: 18px;
    color: var(--bs-white);
}

/* =========================================
   5. CAROUSEL
   ========================================= */

.carousel-item { position: relative; }
.carousel-item::after {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0,0,0,.6);
}
.carousel-caption {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.carousel-content h1 {
    font-size: 3.5rem !important;
    line-height: 1.3;
}
.carousel-item p { max-width: 700px; margin: 0 auto 35px; }

/* Carousel Buttons */
.carousel-caption .carousel-content a button.carousel-content-btn1 {
    background: red;
    color: #000;
    opacity: 1;
    border: 0;
    border-radius: 20px;
}
.carousel-caption .carousel-content a button.carousel-content-btn1:hover {
    background: #000;
    color: #fff;
    border: 0;
    opacity: 1;
    transition: 1s;
    border-radius: 20px;
}

.carousel-caption .carousel-content a button.carousel-content-btn2 {
    background: #000;
    color: var(--bs-white);
    opacity: 1;
    border: 0;
    border-radius: 20px;
}
.carousel-caption .carousel-content a button.carousel-content-btn2:hover {
    background: red;
    color: #000;
    border: 0;
    opacity: 1;
    transition: 1s;
    border-radius: 20px;
}

/* Carousel Controls */
.carousel-control-next, .carousel-control-prev {
    width: 90px;
    height: 60px;
    position: absolute;
    top: 50%;
    background: #000;
    opacity: 1;
}
.carousel-control-prev { left: 0; border-radius: 0 50px 50px 0; }
.carousel-control-next { right: 0; border-radius: 50px 0 0 50px; }
.carousel-control-next:hover, .carousel-control-prev:hover {
    background: red;
    transition: .8s;
}

#carouselId .carousel-indicators li {
    width: 30px;
    height: 10px;
    background: #000;
    margin: 10px;
    border-radius: 30px;
    opacity: 1;
}
#carouselId .carousel-indicators li:hover { background: red; opacity: 1; }

/* =========================================
   6. SERVICES
   ========================================= */

.services .services-item {
    box-shadow: 0 0 60px rgba(0,0,0,.2);
    width: 100%;
    height: 100%;
    border-radius: 10px;
    padding: 10px 0;
    position: relative;
}
.services-content::after {
    position: absolute;
    content: "";
    width: 100%;
    height: 0;
    left: 0;
    border-radius: 10px;
    background: #000;
    transition: .5s;
    top: 0;
    bottom: auto;
}
.services-item:hover .services-content::after { height: 100%; opacity: 1; transition: .5s; }
.services-item:hover .services-content-icon { position: relative; z-index: 2; }
.services-item:hover .services-content-icon i,
.services-item:hover .services-content-icon p { color: red !important; }
.services-item:hover .services-content-icon p { color: var(--bs-white); } /* Fix logic from original */
.services-item .services-content-icon i, 
.services-item .services-content-icon p { transition: .5s; }

/* =========================================
   7. GALLERY & PORTFOLIO (FIXED FOR DESKTOP)
   ========================================= */

.gallery-section { background-color: #f8f8f8; }
.image-gallery { padding: 30px 0; }

.gallery-container {
    display: grid;
    /* 5 columns on large screens so images aren't huge */
    grid-template-columns: repeat(5, 1fr); 
    /* Add space between images so it doesn't look like a wall */
    grid-gap: 20px; 
    max-width: 100%;
    margin: 0;
    /* Add breathing room on the far edges */
    padding: 0 20px; 
}

/* Adjust for standard laptops (4 columns) */
@media (max-width: 1400px) {
    .gallery-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
    transition: .4s ease-in-out;
    /* Enforce a standard height for consistency */
    height: 300px; 
}

.gallery-item:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,.3); }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures images fill the square without stretching */
    display: block;
    filter: brightness(.95);
    transition: filter .4s;
}
.gallery-item:hover img { filter: brightness(1); }

/* Make the 'Large' item span 2 columns correctly */
.gallery-item.large { grid-column: span 2; grid-row: span 2; height: 620px; /* Double height + gap */ }

.caption {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 20px;
    background: linear-gradient(to top,rgba(255,0,0,.8) 0,rgba(0,0,0,0) 60%);
    color: #fff;
    opacity: 0;
    transition: opacity .4s;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
    font-size: 1.5em;
    font-weight: 700;
}
.gallery-item:hover .caption { opacity: 1; }

.portfolio-item-wrap { margin-bottom: 25px; }
.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,.1);
}
.portfolio-item img { width: 100%; height: 250px; object-fit: cover; }
.portfolio-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: rgba(4,25,60,.85);
    color: #fff;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity .3s;
}
.portfolio-item:hover .portfolio-caption { opacity: 1; }

/* =========================================
   8. PRICING TABLE
   ========================================= */

.pricing-table {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    padding: 60px 20px;
    background-color: #1a1a1a;
    font-family: sans-serif;
}
.pricing-plan {
    flex: 1;
    max-width: 320px;
    background-color: #2c2c2c;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,.4);
    padding: 30px;
    text-align: center;
    transition: transform .4s, box-shadow .4s, border .4s;
    border: 2px solid transparent;
}
.pricing-plan:not(.featured):hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(255,0,0,.2);
    border: 2px solid red;
}
.pricing-plan.featured {
    background-color: red;
    color: #000;
    transform: scale(1.08);
    box-shadow: 0 10px 40px rgba(255,0,0,.5);
    border: 3px solid #000;
}
.pricing-plan.featured .plan-price span, .pricing-plan.featured .plan-title { color: #000; }

.plan-title { font-size: 2em; margin-bottom: 10px; font-weight: 700; color: red; }
.plan-price { font-size: 3.5em; font-weight: 600; margin-bottom: 25px; line-height: 1.1; }
.plan-price span { font-size: .35em; font-weight: 300; display: block; opacity: .8; }

.plan-features {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
    text-align: left;
    border-top: 1px solid #444;
}
.plan-features li {
    padding: 12px 0 12px 30px;
    border-bottom: 1px solid #444;
    font-size: 1.05em;
    position: relative;
}
.plan-features li:before { content: '★'; color: red; position: absolute; left: 0; font-size: 1.2em; }
.plan-features li.unavailable { opacity: .5; text-decoration: none; }
.plan-features li.unavailable:before { content: '—'; color: #888; }

.plan-button {
    display: block;
    padding: 14px 25px;
    text-decoration: none;
    color: #000;
    background-color: red;
    border-radius: 5px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: background-color .3s, color .3s;
    border: none;
}
.plan-button:hover { background-color: #e60000; color: #fff; }
.pricing-plan.featured .plan-button { background-color: #000; color: red; border: 2px solid red; }
.pricing-plan.featured .plan-button:hover { background-color: #333; color: red; }

/* =========================================
   9. PROJECTS & TEAMS
   ========================================= */

.project-img { position: relative; padding: 10px; }
.project-img::before {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    top: 0;
    left: 0;
    background: red;
    border-radius: 10px;
    opacity: 1;
    z-index: -1;
    transition: .5s;
}
.project-img::after {
    content: "";
    width: auto;
    height: auto;
    position: absolute;
    right: 0;
    bottom: 0;
    background: #000;
    border-radius: 10px;
    opacity: 1;
    z-index: -1;
    transition: .5s;
}
.project-content {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}
.project-content a { display: inline-block; padding: 20px 25px; background: #000; border-radius: 10px; }
.project-item:hover .project-content { opacity: 1; transition: .5s; }
.project-item:hover .project-img::after, .project-item:hover .project-img::before { opacity: 0; }

.team-item { border-top: 30px solid red !important; background: rgba(239,239,241,.8); }
.team-item:hover h4 { color: #000; transition: .5s; }
.team-content::before {
    height: 200px;
    display: block;
    content: "";
    position: relative;
    top: -101px;
    background: red;
    clip-path: polygon(50% 50%, 100% 50%, 50% 100%, 0% 50%);
    padding: 60px;
    opacity: 1;
}
.team-img-icon { position: relative; margin-top: -200px; padding: 30px 30px 0; }
.team-img { border: 15px solid var(--bs-white); }
.team-img img { border: 10px solid red; transition: .5s; }
.team-item:hover .team-img img { transform: scale(1.05); border: 10px solid red; }

.team-carousel .owl-stage { position: relative; width: 100%; height: 100%; }
.team-carousel .owl-nav { position: absolute; top: -100px; right: 50px; display: flex; }
.team-carousel .owl-nav .owl-next, .team-carousel .owl-nav .owl-prev {
    width: 56px;
    height: 56px;
    border-radius: 56px;
    margin-left: 15px;
    background: red;
    color: var(--bs-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .5s;
}
.team-carousel .owl-nav .owl-next:hover, .team-carousel .owl-nav .owl-prev:hover { background: #000; color: var(--bs-white); }

/* =========================================
   10. BLOG, TESTIMONIALS & CONTACT
   ========================================= */

.blog-item .blog-btn { z-index: 2; }
.blog-btn .blog-btn-icon { height: 50px; position: relative; overflow: hidden; }
.blog-icon-1 { position: relative; top: -4px; }
.blog-icon-2 { display: flex; position: absolute; top: 6px; left: -140px; }
.blog-btn-icon:hover .blog-icon-2 { transition: 1s; left: 5px; top: 6px; padding-bottom: 5px; }
.blog-btn-icon:hover .blog-icon-1 { top: 0; right: -140px; transition: 1s; }
.blog-coment d-flex { background: #000 !important; }

.testimonial-item { background: #e3f0eb; }
.testimonial-carousel .owl-item .testimonial-item { transition: .5s; }
.testimonial-carousel .owl-dots { margin-top: 15px; display: flex; align-items: flex-end; justify-content: center; }
.testimonial-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin: 0 5px;
    width: 15px;
    height: 15px;
    background: #c1dad0;
    border-radius: 15px;
    transition: .5s;
}
.testimonial-carousel .owl-dot.active { width: 30px; background: red; }
.testimonial-carousel .owl-item.center { position: relative; z-index: 1; }
.testimonial-carousel .owl-item.center .testimonial-item { background: #fff !important; box-shadow: 0 0 30px #ddd; }

.contact-detail::before {
    position: absolute;
    content: "";
    height: 50%;
    width: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(rgba(0,0,0,.8),rgba(0,0,0,.3)) 0 0/cover, url(../img/background.jpg) center center/cover no-repeat;
    border-radius: 10px;
    z-index: -1;
}
.contact-form, .contact-map { background: red; }
.contact-detail .flex-shrink-0.btn-square.bg-secondary, 
.contact-form .btn.bg-primary { background-color: #000 !important; }

.footer .contact-link a i { color: red !important; }
.footer .contact-link a:hover, 
.footer .help-link a:hover, 
.footer .short-link a:hover { color: red !important; letter-spacing: 1px; }
.footer .hightech-link a:hover { background: red; border: 0; }

/* =========================================
   11. MEDIA QUERIES (MOBILE FIXES)
   ========================================= */

@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        visibility: hidden;
        top: 100%;
        transform: rotateX(-75deg);
        transform-origin: 0% 0%;
        transition: .5s;
        opacity: 0;
    }
}

@media (max-width: 992px) {
    .gallery-container { grid-template-columns: repeat(2, 1fr) !important; grid-gap: 15px; }
    .gallery-item.large { grid-column: span 1; grid-row: span 1; }
    
    .carousel-caption h1 { font-size: 2rem !important; }
    .carousel-item, .carousel-item img { min-height: 500px; object-fit: cover; }
    .carousel-item h1 { font-size: 40px !important; }
    .carousel-item p { font-size: 16px !important; }

    .team-carousel { margin-top: 3rem; }
    .team-carousel .owl-nav {
        top: -85px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        margin-left: -15px;
    }
}

@media (max-width: 900px) {
    .pricing-table { flex-direction: column; align-items: center; padding: 40px 15px; }
    .pricing-plan { max-width: 90%; margin-bottom: 30px; }
    .pricing-plan.featured { transform: scale(1.05); }
}

@media (max-width: 768px) {
    /* Navbar */
    .navbar-nav { background-color: #000; padding: 1rem; }
    .navbar-nav .nav-link { color: #fff !important; text-align: center; }
    
    /* Counter */
    .counter { justify-content: center; margin-bottom: 20px; }
    .counter h1 { font-size: 2rem; }
    .counter h5 { font-size: 1rem; }
    
    /* Carousel */
    .carousel-caption h1 { font-size: 1.75rem; line-height: 1.2; }
    .carousel-caption p { font-size: .95rem; display: none; } /* Hide paragraph on small phones */
    .carousel-content button { margin-top: 10px; padding: 8px 16px; }
    .carousel-item, .carousel-item img { min-height: 400px; object-fit: cover; }
    .carousel-item h1 { font-size: 28px !important; }
    
    /* Utility */
    .position-relative img.w-75 { width: 100% !important; margin: 0 !important; }
    .position-absolute.w-75 { position: static !important; width: 100% !important; }
    footer .d-flex { flex-direction: column; text-align: center; }
    
    /* Spacing & Font Adjustments */
    .p-5 { padding: 1.5rem !important; }
    .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
    
    /* Hero/Banner Text Shrink */
    .display-1 { font-size: 2rem !important; }
    .carousel-caption h6 { font-size: 0.9rem !important; }
    
    /* Buttons in Hero */
    .carousel-content-btn1, .carousel-content-btn2 {
        padding: 8px 20px !important;
        font-size: 0.9rem !important;
        margin-bottom: 10px;
    }
    
    /* Fix overlapping images in about section */
    .h-100.position-relative { margin-bottom: 50px; text-align: center; }
    
    /* Gallery Stack */
    .gallery-container { grid-template-columns: 1fr !important; gap: 15px; }
    .gallery-item.large { grid-column: span 1 !important; grid-row: span 1 !important; }
}

@media (max-width: 576px) {
    .services-item { margin-bottom: 20px; }
    .services-content-icon i { font-size: 3rem; }
    .gallery-item img { height: auto; }
    .gallery-container { grid-template-columns: 1fr; }
}