/* 
 * Rackbar Holdings Ltd - Main Stylesheet
 * Contains global styles, animations, and responsive design
 * Author: Rackbar Development Team
 */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Montserrat:wght@400;600;700&family=Roboto:wght@300;400;500;700&display=swap');

/* Loading Animation */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(128, 128, 128, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 40px;
    height: 40px;
    position: relative;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #d4af37;
    border-bottom-color: #800000;
    animation: spin 1.5s linear infinite;
}

.loader::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-left-color: #800000;
    border-right-color: #d4af37;
    animation: spin 1s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

body {
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    color: #333;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

p {
    font-family: 'Roboto', sans-serif;
}

/* Header */
header {
    background-color: transparent;
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(5px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    max-width: 1200px;
    max-height: 80px;
    margin-left: 1.5rem;
    margin-right: 7rem;
    font-family: 'Montserrat', sans-serif;
}

.logo {
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
    padding-top: 0.05rem;
    padding-bottom: 0.05rem;
}

.logo img {
    height: 70px;
}

/* Navigation */
.menu-toggle {
    display: none;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #000;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: rgba(0, 0, 0, 0.12);
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    text-decoration: none;
    color: #000;
    font-weight: normal;
    font-size: larger;
    font-family: 'Montserrat', sans-serif;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.slideshow .slide:nth-child(6) {
    animation: slideZoomIn 32s infinite;
}

.hero .container {
    max-width: 1200px;
    margin: 0;
    margin-left: 5rem;
    margin-top: 10rem;
    padding: 0 2rem;
    text-align: left;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0rem;
    text-align: left;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 0rem;
    text-align:left ;
}

.hero h3 {
    font-size: 1rem;
    margin-bottom: 0rem;
    text-align: left;
}

.btn {
    background-color: #800000;
    color: #fff;
    padding: 0.7rem 2rem;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
}

.btn:hover {
    background-color: #600000;
}

/* Sections */
section {
    padding: 4rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

/* Services */
.services h2 {
    font-size: 1.7rem; /* Change this value to adjust the text size */
    text-align: center; /* Options: left, center, right to move it horizontally */
    margin-top: 0rem; /* Adjust space above the text */
    margin-bottom: 2rem; /* Adjust space below the text */
    font-weight: 600;
    
}

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
}

.service-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 2rem;
    padding: 0rem 0rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}

.service-carousel::-webkit-scrollbar {
    display: none;
}

.service-item {
    background-color: #f9f9f900;
    padding: 1rem;
    text-align: left;
    flex: 0 0 calc(28% - 1rem); /* Fits 3 items perfectly and shows peeping edges */
    min-width: 280px;
    scroll-snap-align: center;
    box-sizing: border-box;
    font-size: 0.8rem;
}

.service-item img {
    width: 320px;
    height: 200px;
    object-fit: cover;
}

.service-item h3 {
    margin: 1rem 0;
}

.details {
    color: #800000;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    
}

.carousel-btn {
    background-color: #800000;
    color: white;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 35%; /* Adjusted to move the buttons higher, aligning with images */
    transform: translateY(-50%);
    z-index: 10;
    font-size: 1rem;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: background-color 0.3s;
}

.carousel-btn:hover {
    background-color: #600000;
}

.prev-btn {
    left: -20px;
}

.next-btn {
    right: -20px;
}

/* Leading Construction */
.leading h2 {
    font-size: 1.8rem; /* Change this value to adjust the section title size */
    text-align: center; /* Options: left, center, right to move it horizontally */
    margin-bottom: 7rem; /* Adjust space below the title */
    color: #ffffff; /* Change the title text color here */
}

.leading-item h3 {
    font-size: 1.2rem; /* Adjust the size of the grid item titles (e.g., BEST QUALITY) */
    margin-bottom: 0.5rem; /* Adjust space below the item titles */
    color: #333; /* Adjust the color of the item titles */
}

.leading-item p {
    font-size: 0.8rem; /* Adjust the size of the description text */
    color: #555; /* Adjust the color of the description text */
}

.leading {
    position: relative;
    z-index: 1;
    min-height: 80vh;
    display: flex;
    align-items: center;
    
}

.leading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0; /* Change to right: 0; to place the image on the right side */
    width: 100%;
    height: 40%;
    background-image: url('../static/pexels-nolandlive-34766486.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

.leading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
    ;
}

.leading-item img {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
}

/* Why Choose Us */
.why-choose {
    background-image: linear-gradient(rgba(0, 0, 0, 0.316), rgba(0, 0, 0, 0.278)), url('../static/pexels-vlasceanu-20643871.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.why-choose .container {
    position: relative; 
    z-index: 1;
}

.why-choose h2 {
    color: #f0f0f0ff;
    font-size: 1.8rem;
   /*text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);*/
}

.qualities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.quality-item {
    background: rgba(0, 0, 0, 0.722);
    border: 1px; /*solid  rgba(150, 49, 37, 0.4);*/
    padding: 2rem;
    border-radius: 8px;
    text-align: left;
    backdrop-filter: blur(5px);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.quality-item:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-5px);
}

.quality-item h3 {
    margin-bottom: 1rem;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quality-item p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ffffffaa;
}

/* Projects Section */
.projects-section {
    background-color: #f9f9f9;
    padding: 5rem 0;
}

.projects-section h2 {
    color: #333;
    margin-bottom: 3rem;
    text-transform: uppercase;
    text-align: left;
    font-size: 1.5rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 360px)); /* Increased min-width for a better 3-column grid size */
    gap: 30px;
}

.project-item {
    background: #fff;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.img-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 240px; /* Slightly taller images to balance the wider grid cards */
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-item:hover .img-wrapper img {
    transform: scale(1.1);
}

.project-content {
    padding: 0.8rem;
    text-align: left;
    position: relative;
    
}

/* Animated maroon edit line that expands on hover */
.project-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0; /* Starts hidden */
    height: 4px; /* Line thickness */
    background-color: #800000;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.project-item:hover .project-content::after {
    width: 100%; /* Expands to full width */
}

.project-content h3 {
    margin: 0 0 0.5rem;
    color: #000000;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    
}

/* Footer */
footer {
    background-image: linear-gradient(rgba(17, 17, 17, 0.841), rgba(17, 17, 17, 0.95)), url('../static/pexels-pixabay-41949.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #bbb;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section img {
    height: 100px;
    margin-bottom: 1rem;
    filter: none;
}

.footer-section h4 {
    color: #bbb;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section p {
    color: #bbb;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-section ul li a:hover {
    color: #fff;
    padding-left: 5px;
}

.copyright {
    text-align: center;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1.5rem;
    color: #bbb;
}

/* Responsive */
@media (max-width: 1024px) {
    header .container {
        padding: 1rem 1rem 0.5rem;
        margin: 0;
    }

    .hero .container {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.75rem;
        align-items: center;
        padding: 0.5rem;
        min-height: 70px;
    }

    .logo {
        margin: 0;
        align-self: center;
    }

    .menu-toggle {
        display: block;
        order: 2;
        align-self: center;
    }

    nav {
        width: 100%;
        order: 3;
    }

    nav ul {
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        display: none;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        z-index: 99;
    }

    nav ul.show {
        display: flex;
    }

    nav ul li {
        width: 100%;
        margin: 0;
        padding: 0.9rem 1rem;
        border-bottom: 1px solid #ddd;
        text-align: left;
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    .hero {
        min-height: 70vh;
        height: auto;
        padding-top: 6.5rem;
    }

    .hero .container {
        margin: 0 auto;
        margin-top: 6rem;
        padding: 0 1rem;
        text-align: center;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero h3 {
        font-size: 1rem;
    }

    .btn {
        width: auto;
    }

    .carousel-container {
        flex-direction: column;
        gap: 1rem;
    }

    .service-carousel {
        gap: 1rem;
    }

    .service-item {
        flex: 0 0 85%;
        min-width: 85%;
    }

    .carousel-btn {
        display: none;
    }

    .leading {
        min-height: auto;
        padding: 4rem 1rem 2rem;
    }

    .leading::before {
        height: 240px;
    }

    .leading-grid {
        gap: 1rem;
    }

    .projects-section {
        padding: 3rem 0;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-item {
        max-width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-section {
        text-align: left;
    }

    .why-choose h2 {
        font-size: 1.6rem;
    }

    .qualities-grid {
        gap: 1rem;
    }
}
header {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

header.hide {
    transform: translateY(-100%);
    opacity: 0;
}
html, body {
    overflow-x: hidden;
}