/*
 * styles.css
 *
 * This stylesheet contains all custom styles for the website, including layout, responsive design, navigation, landing page, carousel, and footer adjustments.
 * Each section and class is commented to clarify its purpose and logic for future maintainers.
 * Duplicate class blocks have been merged and formatting improved for clarity and maintainability.
 */

body {
    font-family: 'Roboto Black';
}

/* CSS Variables for consistent theming */
:root {
    --navbar-height: 56px;
    --navbar-height-scrolled: 48px;
}

/* Active Navigation State: highlights active nav items and custom green text */
.active-nav-item,
.text-custom-lightgreen,
#career-dropdown.text-custom-lightgreen {
    color: var(--color-custom-lightgreen) !important;
}

/* Landing Section: hero background and layout */
.landing {
    background: linear-gradient(#BF161De6, #BF161De6), url(../img/Web/bg-hero.webp);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

/* Navbar Base Styles: default navbar appearance */
#navbar {
    transition: background-color 0.1s ease, padding 0.1s ease;
    padding: 1rem 0;
    background-color: transparent;
    width: 100%;
}

/* Navbar Scrolled State: sticky navbar on scroll */
.scrolled {
    background-color: #BF161C !important;
    padding: 0 0 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.scrolled .h-14 {
    height: var(--navbar-height-scrolled);
    transition: 0.3s ease;
}

/* Navbar Container - Full Width Fix */
#navbar .max-w-screen-xl {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 793px) {
    /* Desktop navbar container width */
    #navbar .max-w-screen-xl {
        margin-left: auto;
        margin-right: auto;
    }

    /* Not index page layout for desktop */
    .not-index {
        margin-top: 4rem;
        padding: 3rem 2rem;
    }
    
    .not-index .landing-content {
        padding: 0 2rem;
        margin-top: 0; /* Consistent for desktop */
    }
    
    .not-index .flex.flex-col.items-center {
        margin-top: 0; /* Reset for desktop */
    }
    
    .not-index .text-white.mb-8 {
        margin-bottom: 2rem; /* Consistent with mobile */
    }
    
    .not-index h1 {
        font-size: 3rem;
        margin-top: 0.5rem;
    }
    
    .not-index .text-xl {
        font-size: 1.1rem;
    }
}

/* Button Styles: improves usability and disables text selection */
#navbar-sticky button[type="button"],
.group button {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Dropdown Hover States: highlights active dropdown */
.active-dropdown > button {
    color: var(--color-custom-lightgreen);
}

/* Landing Content: main content area on landing page */
.landing-content {
    width: 100%;
    padding: 0 6rem;
    margin-top: 2rem;
}

.landing-content .grid {
    gap: 3rem;
}

/* Dropdown Button Width: sets width for dropdown button */
#dropdownHoverButton {
    width: 9rem;
}

@media (min-width: 793px) {
    /* Desktop Dropdown Positioning: centers dropdown menus */
    .group {
        position: relative;
    }
    
    .group-hover\:block {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: 100%;
        min-width: 10rem;
        z-index: 50;
    }
}

/* Popup Modal: overlay background for modals */
#popupModal {
    background: rgba(0, 0, 0, 0.8);
}

/* Category Item Hover: card hover effect for categories */
.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px #BF161C;
}

.category-item {
    transform: translateY(0);
    transition: transform 0.3s ease;
}

/* Back to Top Button: pointer cursor for usability */
#btn-back-to-top {
    cursor: pointer;
}

/* Not Index Page: layout for non-index pages (desktop) */
.not-index {
    margin-top: 4rem;
    padding: 3rem 2rem;
}

.not-index .landing-content {
    padding: 0 2rem;
    margin-top: 0; /* Reset margin-top that may conflict */
}

.not-index h1 {
    font-size: 3rem;
    margin-top: 0.5rem;
}

.not-index .text-xl {
    font-size: 1.1rem;
}

.not-index .max-w-4xl, .not-index .max-w-2xl {
    max-width: 90%;
    margin-top: 2rem;
}

/* Mobile Navigation (< 793px): responsive navbar and menu for mobile */
@media (max-width: 792px) {
    #navbar {
        background-color: rgba(191, 22, 29, 0.9);
        width: 100%;
        left: 0;
        right: 0;
    }
    
    #navbar .flex.flex-wrap {
        width: 100%;
        margin: 0;
        padding: 0 1rem;
    }
    
    #navbar-sticky {
        background-color: #BF161C;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 19;
        padding: 1rem;
        margin: 0;
    }
    
    #navbar-sticky .flex-col {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    #navbar-sticky .group {
        margin-bottom: 0.5rem;
        width: 100%;
        position: relative;
    }
    
    #navbar-sticky button {
        width: 100%;
        text-align: left;
        justify-content: left;
    }
    
    /* Language and Buy Now buttons */
    #navbar-sticky .group.w-full.md1\:w-auto button[type="button"],
    #navbar-sticky #dropdownHoverButton {
        width: 9rem;
        text-align: center;
        justify-content: center;
    }
    
    /* Mobile dropdown menus */
    #navbar-sticky .group-hover\:block {
        position: static;
        left: 0;
        transform: none;
        top: auto;
        margin-top: 0;
        width: auto;
        box-shadow: none;
        margin-inline-start: 2rem;
        margin-inline-end: 2rem;
        border-left: 2px solid #eee;
        text-align: left;
    }
    
    #navbar-sticky .group:hover .group-hover\:block {
        display: block;
    }
    
    /* Landing adjustments for mobile */
    .landing {
        align-items: flex-start;
        text-align: center;
        padding-bottom: 3rem;
    }
    
    .landing-content {
        padding: 0 2rem;
        transition: padding-top 0.3s ease;
    }
    
    .landing-content .grid {
        grid-template-columns: 1fr;
    }
    
    .landing h1 {
        font-size: 2.5rem;
        margin-top: 4rem;
    }
    
    .landing .text-white {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .landing .inline-block {
        margin-top: 1rem;
    }
}

/* Small Mobile (320px - 640px): further responsive adjustments */
@media (min-width: 320px) and (max-width: 640px) {
    #navbar {
        padding: 0.75rem 0;
    }
    
    #navbar .max-w-screen-xl {
        padding: 0 0.75rem;
    }
    
    .landing-content {
        padding-top: 0px;
        padding-bottom: 30px;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .landing-content h1 {
        font-size: 2rem;
    }
    
    .landing-content p {
        font-size: 1rem;
    }
    
    .why-choose-us, .product-category {
        padding: 40px 0;
    }
    
    .max-w-screen-xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h2 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    .grid {
        gap: 1rem;
    }
    
    #navbar .h-14 {
        height: 3rem;
    }
    
    .landing-content a {
        padding: 0.5rem 1.5rem;
    }
    
    .carousel-indicators button {
        width: 12px;
        height: 12px;
        margin: 0 4px;
    }
    
    /* Not index pages (mobile) */
    .not-index {
        padding: 2rem 1rem;
    }
    
    .not-index .landing-content {
        padding: 0 1rem;
        margin-top: 0; /* Remove conflicting margin-top */
    }
    
    .not-index h1 {
        font-size: 2rem;
        margin-top: 0.5rem;
    }
    
    .not-index .text-xl {
        font-size: 1rem;
    }
    
    .not-index .max-w-4xl, .not-index .max-w-2xl {
        max-width: 100%;
        margin-top: 1.5rem;
    }
    
    /* Remove conflicting override */
    .not-index.landing-content {
        margin-top: 0 !important;
    }
}

/* Medium Tablet (793px - 875px): tablet-specific navbar and button sizing */
@media (min-width: 793px) and (max-width: 875px) {
    #navbar .max-w-screen-xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    #navbar .h-14 {
        height: 3.25rem;
    }
    
    .md1\:space-x-4 > * {
        margin-left: 0.5rem !important;
        margin-right: 0 !important;
    }
    
    #navbar-sticky .py-2.px-3 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        font-size: 0.875rem;
    }
    
    #navbar-sticky .md1\:flex-row > div:first-child {
        margin-left: 0 !important;
    }
    
    #dropdownHoverButton {
        width: 7.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    #navbar-sticky button[type="button"] {
        font-size: 0.875rem;
    }
    
    #navbar-sticky .md1\:flex {
        width: 100%;
        justify-content: space-between;
    }
    
    #navbar-sticky .md1\:mt-0 {
        margin-left: auto;
    }
}

/* Tight Tablet (793px - 830px): even tighter navbar and button sizing */
@media (min-width: 793px) and (max-width: 830px) {
    #navbar-sticky .py-2.px-3 {
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }
    
    #navbar-sticky .md1\:hover\:text-custom-lightgreen {
        font-size: 0.8125rem;
    }
    
    #dropdownHoverButton {
        width: 7rem;
    }
}

/* Large Tablet (876px - 1000px): large tablet navbar and button sizing */
@media (min-width: 876px) and (max-width: 1000px) {
    #navbar-sticky .py-2.px-3 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        font-size: 0.875rem;
    }
    
    .md1\:space-x-4 > * {
        margin-left: 0.5rem !important;
    }
    
    #dropdownHoverButton {
        width: 7rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        font-size: 0.875rem;
    }
    
    #navbar .h-14 {
        height: 3rem;
    }
    
    #navbar .p-4 {
        padding: 0.75rem;
    }
    
    #navbar-sticky button[type="button"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        font-size: 0.875rem;
    }
    
    #navbar-sticky .md1\:flex-row > div:first-child {
        margin-left: 0 !important;
    }
}

/* History Carousel: styles for the timeline/history carousel */
.history-carousel-container {
    overflow: hidden;
    margin: 2rem 0;
    position: relative;
}

.history-track {
    display: flex;
    transition: transform 0.6s ease-in-out;
}

.history-item {
    min-width: 100%;
    padding: 0 1rem;
}

.history-item .bg-white {
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    min-height: 400px;
}

.history-flex-container {
    display: flex;
    gap: 2rem;
    height: 100%;
}

.history-image {
    flex: 0 0 50%;
    max-width: 50%;
    overflow: hidden;
    border-radius: 0.5rem;
}

.history-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

.history-content-wrapper {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
}

.history-year {
    font-size: 2.5rem;
    font-weight: bold;
    color: #BF161C;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.history-year:after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 80px;
    height: 4px;
    background-color: #BF161C;
}

.history-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.history-carousel-indicators {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.history-carousel-indicators button {
    transition: all 0.3s ease;
}

.history-carousel-indicators button.scale-125 {
    transform: scale(1.25);
}

.history-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    padding: 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
    transition: all 0.2s ease;
}

.history-carousel-nav:hover {
    background-color: #f3f4f6;
    transform: translateY(-50%) scale(1.1);
}

.history-carousel-prev {
    left: 1rem;
}

.history-carousel-next {
    right: 1rem;
}

/* History Mobile Fixes: adjusts carousel for mobile layout */
@media (max-width: 792px) {
    .history-flex-container {
        flex-direction: column;
        gap: 1.5rem;
        overflow: visible;
    }
    
    .history-image, .history-content-wrapper {
        flex: 0 0 100%;
        max-width: 100%;
        overflow: visible;
    }
    
    .history-content-wrapper {
        min-height: 200px;
        display: block;
    }
    
    .history-content {
        font-size: 1rem;
        line-height: 1.6;
        display: block;
        overflow: visible;
    }
    
    .history-item {
        height: auto;
        overflow: visible;
    }
    
    .history-item .bg-white {
        height: auto;
        min-height: auto;
        overflow: visible;
        padding-bottom: 2rem;
    }
    
    .history-carousel-nav {
        display: none !important;
    }
}

/* Center History on Desktop: centers carousel on large screens */
@media (min-width: 793px) {
    .history-carousel-container {
        max-width: 90%;
        margin: 0 auto;
    }
    
    .history-item {
        display: flex;
        justify-content: center;
    }
}

/* Footer Alignment Mobile: aligns footer content for mobile */
@media (max-width: 792px) {
    footer .flex-col.items-center {
        align-items: flex-start !important;
        text-align: left;
    }
    
    footer .text-center.md\:text-left {
        text-align: left !important;
    }
    
    footer .max-w-screen-xl {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Fixed Header Alignment Mobile: ensures consistent header and content spacing on mobile */
@media (max-width: 792px) {
    .not-index {
        margin-top: 5rem; /* Consistent for mobile */
        padding: 2rem 1rem;
    }
    
    .not-index .landing-content {
        padding: 0 1rem;
        margin-top: 0; /* Remove conflicting margin-top */
    }
    
    .not-index .flex.flex-col.items-center {
        margin-top: 0; /* Reset margin-top for mobile */
    }
    
    .not-index .text-white.mb-8 {
        margin-bottom: 2rem; /* Consistent spacing */
    }
    
    .not-index h1 {
        font-size: 2.5rem;
        margin-top: 0.5rem;
    }
    
    .not-index .text-xl {
        font-size: 1rem;
    }
    
    .not-index .max-w-4xl, .not-index .max-w-2xl {
        max-width: 100%;
        margin-top: 1.5rem;
    }
}

/* Example: Add this to public/css/styles.css */
@media (min-width: 1440px) { /* For large desktop screens */
    html {
        font-size: 18px; /* Increase base font size from default 16px */
    }
}
@media (min-width: 1920px) { /* For very large/widescreen monitors */
    html {
        font-size: 24px; /* Further increase base font size */
    }
}

/* Example: Adjusting max-width for content */
@media (min-width: 1440px) {
    .max-w-screen-xl { /* Apply to elements currently using this class */
        max-width: 1440px; /* Adjust as needed */
    }
}
@media (min-width: 1920px) {
    .max-w-screen-xl {
        max-width: 1920px; /* Adjust as needed */
    }
}