/*
 * KMSOFT Common CSS
 * Reusable classes for containers, spacing, and layout.
 * Designed to be used across all pages of the KMSOFT Web project.
 */

:root {
    /* Color Palette */
    --primary-color: #146d59;
    --dark-color: #121a2b;
    --white-color: #ffffff;
    --light-bg: #f4f5f6;
    --text-color: #2b3241;
    --text-gray: #767b85;
    
    /* Layout Variables */
    --container-max-width: 1400px;
    --container-large-width: 1680px;
    --section-padding: 100px;
    --section-padding-mobile: 60px;

    /* Header Colors */
    --header-bg: transparent;
    --header-text: #ffffff;
    --header-border: transparent;
    --logo-filter: brightness(0) invert(1);
}

/* --- Header Styles --- */
.header-wrapper {
    width: 100%;
    z-index: 9999;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transition: all 0.3s ease;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
}

/* Header Style Overrides */
body[data-header-style="white"] {
    --header-bg: #ffffff;
    --header-text: #1C1C1C;
    --header-border: transparent;
    --logo-filter: brightness(0) !important;
}

body[data-header-style="index"] .header-wrapper {
    background: transparent;
}

.header-wrapper.scrolled {
    background: #ffffff !important;
    border-bottom: 1px solid transparent !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-wrapper.scrolled .nav-item {
    color: #1C1C1C !important;
}

/* common.css: Around Line 66 */
.header-wrapper.scrolled .services-arrow,
.header-wrapper.scrolled .products-arrow {
    filter: brightness(0) !important; 
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 100px;
    transition: all 0.3s ease;
    max-width: 1920px;
    margin: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    color: var(--header-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.services-arrow, .products-arrow {
    width: 16px;
    height: 16px;
    margin-left: 5px;
    filter: var(--logo-filter);
}

/* Dropdowns */
.services-dropdown, .products-dropdown {
    position: relative;
}

.services-menu, .products-menu {
    position: absolute;
    top: 35px;
    left: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: none;
    flex-direction: column;
    padding: 20px 30px;
    z-index: 1000;
}

.services-menu.show, .products-menu.show {
    display: flex;
}

.services-menu h1 {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #8E8E93;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.services-menu h2 {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #1C1C1C;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.services-menu h2:hover {
    color: var(--primary-color);
}

.services-menu a {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #1C1C1C;
    margin-bottom: 12px;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.services-menu a:hover {
    color: var(--primary-color);
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--header-text);
    margin: 5px 0;
    transition: 0.3s;
}

@media (max-width: 1024px) {
    .nav-header { padding: 10px 40px; }
    .nav-links { gap: 1.5rem; }
    .nav-item { font-size: 16px; }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-header { padding: 12px 30px; }
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #ffffff;
        flex-direction: column;
        padding: 25px;
        gap: 20px;
    }
    .nav-links.active { display: flex; }
    .nav-item { color: #1C1C1C !important; }
    .services-menu, .products-menu { position: static; width: 100%; box-shadow: none; padding: 10px 0; }
}

/* --- Base Resets (Optional, but helpful for new pages) --- */
.common-reset {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Container Helpers --- */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.container-large {
    width: 100%;
    max-width: var(--container-large-width);
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* --- Page-Specific Containers --- */

/* Index Page Containers */
.index-hero-container {
    width: 100%;
    max-width: 1032px;
    margin: 0 auto;
    padding: 0 20px;
}

.index-business-container,
.index-portfolio-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Services Page Containers */
.services-container,
.services-branding-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
}

/* About Us Page Containers */
.about-hero-container {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 0 120px;
}

.about-content-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Case Study Page Containers */
.casestudy-hero-container,
.casestudy-grid-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Blogs Page Containers */
.blog-hero-container,
.blog-grid-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Contact Page Containers */
.contact-form-container,
.contact-faq-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Section Spacing --- */
.section {
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
}

.section-top {
    padding-top: var(--section-padding);
}

.section-bottom {
    padding-bottom: var(--section-padding);
}

@media screen and (max-width: 768px) {
    .section {
        padding-top: var(--section-padding-mobile);
        padding-bottom: var(--section-padding-mobile);
    }
}

/* --- Flexbox & Alignment --- */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.gap-30 { gap: 30px; }
.gap-40 { gap: 40px; }

/* --- Margin & Padding Utilities --- */
.mt-0 { margin-top: 0 !important; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.mt-50 { margin-top: 50px; }

.mb-0 { margin-bottom: 0 !important; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }
.mb-50 { margin-bottom: 50px; }

.pt-0 { padding-top: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }

/* --- Typography Helpers --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-regular { font-weight: 400; }

.h1-title {
    font-size: clamp(36px, 6vw, 80px);
    font-weight: 700;
    line-height: 1.25;
}

.h2-title {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.3;
}

.p-text {
    font-size: clamp(14px, 1.5vw, 18px);
    line-height: 1.6;
    color: var(--text-gray);
}

/* --- UI Utilities --- */
.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

.transition-base {
    transition: all 0.3s ease;
}

/* --- Visibility Helpers --- */
.desktop-only { display: block; }
.mobile-only { display: none; }

@media screen and (max-width: 768px) {
    .desktop-only { display: none; }
    .mobile-only { display: block; }
    
    .nav-links {
        display: none;
    }
}
