/* =============================================================
   GLOBAL.CSS — Sankalp Shakti Infra LLP
   Shared design system: variables, resets, typography, navigation,
   footer, buttons, utilities, animations, and responsive breakpoints.
   ============================================================= */

/* ── Theme Variables (Dark Mode Default) ── */
:root {
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-hindi: 'Noto Sans Devanagari', sans-serif;
    --theme-transition: background-color 0.4s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    --container-width: 1280px;

    --bg-primary: hsl(218, 100%, 6%);
    --bg-secondary: hsl(218, 80%, 10%);
    --bg-nav: rgba(0, 12, 32, 0.85);
    --text-primary: hsl(210, 20%, 98%);
    --text-secondary: hsl(218, 20%, 75%);
    --text-muted: hsl(218, 15%, 55%);
    --accent-color: hsl(22, 100%, 48%);
    --accent-color-hover: hsl(22, 100%, 40%);
    --accent-cyan: hsl(180, 100%, 45%); /* Fixed: Bright cyan for dark mode contrast */
    --card-bg: rgba(0, 35, 95, 0.25);
    --card-hover-bg: rgba(0, 35, 95, 0.45);
    --border-color: rgba(0, 35, 95, 0.35);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --form-input-bg: rgba(0, 12, 32, 0.6);
    --form-input-focus-border: hsl(22, 100%, 48%);
    --label-bg: hsl(218, 100%, 6%);
    --btn-outline-hover-bg: rgba(255, 255, 255, 0.05);
}

/* ── Light Theme Variables ── */
[data-theme="light"] {
    --bg-primary: hsl(218, 20%, 97%);
    --bg-secondary: hsl(0, 0%, 100%);
    --bg-nav: rgba(255, 255, 255, 0.9);
    --text-primary: hsl(218, 100%, 12%);
    --text-secondary: hsl(218, 30%, 35%);
    --text-muted: hsl(218, 20%, 55%);
    --accent-color: hsl(22, 100%, 48%);
    --accent-color-hover: hsl(22, 100%, 40%);
    --accent-cyan: hsl(218, 100%, 19%); /* Keep dark blue in light mode for contrast */
    --card-bg: hsl(0, 0%, 100%);
    --card-hover-bg: hsl(0, 0%, 100%);
    --border-color: rgba(0, 35, 95, 0.15);
    --shadow-color: rgba(0, 35, 95, 0.12);
    --form-input-bg: rgba(0, 12, 32, 0.04); /* Fixed: Recessed input style */
    --form-input-focus-border: hsl(22, 100%, 48%);
    --label-bg: hsl(0, 0%, 100%);
    --btn-outline-hover-bg: rgba(0, 35, 95, 0.05);
}

/* ── Base Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }
body {
    background-color: var(--bg-primary, hsl(218, 100%, 6%));
    color: var(--text-primary, hsl(210, 20%, 98%));
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--theme-transition);
}
body.menu-open { overflow: hidden; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}
a { color: inherit; text-decoration: none; transition: color 0.3s ease; }
img { max-width: 100%; height: auto; display: block; }

/* ── Layout Utilities ── */
.container { width: 90%; max-width: var(--container-width); margin: 0 auto; padding: 2rem 0; }
.text-center { text-align: center; }
.text-gradient {
    background: linear-gradient(135deg, var(--accent-color) 0%, hsl(38, 100%, 55%) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3rem; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

/* ── Section Styling ── */
section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-header { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-tag {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}
.section-title { font-size: clamp(2rem, 5vw, 2.5rem); font-weight: 800; }
.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 1rem auto 0 auto;
}

/* ── Button System ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-heading);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}
.btn-primary { background-color: var(--accent-color); color: hsl(220, 30%, 10%); }
.btn-primary:hover {
    background-color: var(--accent-color-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(230, 126, 34, 0.25);
}
.btn-outline { background-color: transparent; color: var(--text-primary); border: 2px solid var(--border-color); }
.btn-outline:hover {
    border-color: var(--text-primary);
    background-color: var(--btn-outline-hover-bg);
    transform: translateY(-2px);
}
.btn-accent { background: transparent; color: var(--accent-cyan); border: 2px solid var(--accent-cyan); padding: 0.6rem 1.5rem; }
.btn-accent:hover {
    background-color: var(--accent-cyan);
    color: hsl(220, 30%, 10%);
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.2);
}
.btn-block { width: 100%; }

/* ── Navigation Header ── */
#main-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: transparent;
    border-bottom: 1px solid transparent;
}
#main-header.glass-nav {
    background-color: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px var(--shadow-color);
}
.header-container {
    width: 90%; max-width: var(--container-width); margin: 0 auto;
    height: 80px; display: flex; justify-content: space-between; align-items: center;
}
.logo { display: flex; align-items: center; }
.logo-img {
    height: 48px; width: auto; object-fit: contain; display: block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.logo:hover .logo-img { transform: scale(1.04); }
.nav-menu { display: flex; gap: 2.25rem; align-items: center; }
.nav-item {
    font-size: 0.95rem; font-weight: 500; position: relative; padding: 0.5rem 0;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}
.nav-item::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-cyan));
    transition: width 0.3s ease;
}
.nav-item:hover, .nav-item.active { color: var(--text-primary); }
.nav-item:hover::after, .nav-item.active::after { width: 100%; }

/* Inner pages don't have a hero overlay, so nav text should use theme colors by default */
/* The home page overrides these for the transparent-over-hero state */

.nav-btn {
    background-color: var(--accent-color); color: hsl(220, 30%, 10%);
    padding: 0.5rem 1.25rem; border-radius: 6px; font-weight: 600; font-size: 0.9rem;
}
.nav-btn:hover { background-color: var(--accent-color-hover); transform: translateY(-1px); }
.header-actions { display: flex; align-items: center; gap: 1.25rem; }

/* Theme Toggle Button */
.theme-icon-btn {
    background: none; border: none; cursor: pointer; font-size: 1.2rem;
    color: var(--text-secondary);
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--border-color);
    transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}
.theme-icon-btn:hover {
    color: var(--text-primary); border-color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .theme-icon-btn:hover { background-color: rgba(0, 35, 95, 0.05); }

[data-theme="dark"] .light-icon { display: block; }
[data-theme="dark"] .dark-icon { display: none; }
[data-theme="light"] .light-icon { display: none; }
[data-theme="light"] .dark-icon { display: block; }

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none; flex-direction: column; justify-content: space-between;
    width: 24px; height: 18px; background: none; border: none; cursor: pointer;
}
.mobile-toggle .bar { width: 100%; height: 2px; background-color: var(--text-primary); transition: transform 0.3s ease, opacity 0.3s ease; }

/* ── Footer ── */
.main-footer {
    background-color: hsl(220, 25%, 5%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5rem 0 2rem 0;
    color: hsl(218, 20%, 75%); /* Hardcoded light text for dark footer */
}
.footer-grid { display: grid; grid-template-columns: 2fr repeat(2, 1fr); gap: 4rem; margin-bottom: 4rem; }
.main-footer .logo { display: inline-flex; background: rgba(255, 255, 255, 0.85); padding: 0.2rem 0.6rem; border-radius: 8px; backdrop-filter: blur(4px); margin-bottom: 1rem; }
.footer-desc { margin-top: 1rem; font-size: 0.9rem; color: hsl(218, 15%, 55%); max-width: 350px; }
.social-links { margin-top: 1.5rem; display: flex; gap: 1rem; }
.social-links a {
    width: 36px; height: 36px; border-radius: 50%;
    background-color: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    color: hsl(218, 15%, 55%); transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}
.social-links a:hover { color: var(--accent-color); border-color: var(--accent-color); background-color: rgba(230, 126, 34, 0.1); }
.footer-links-col h5 { color: hsl(210, 20%, 98%); font-size: 1.05rem; margin-bottom: 1.5rem; }
.footer-links-col ul { list-style: none; }
.footer-links-col ul li { margin-bottom: 0.75rem; }
.footer-links-col ul li a { font-size: 0.9rem; color: hsl(218, 15%, 55%); }
.footer-links-col ul li a:hover { color: hsl(210, 20%, 98%); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 2rem; font-size: 0.85rem; color: hsl(218, 15%, 55%); }

/* ── Scroll Reveal Animations ── */
.scroll-reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.scroll-reveal.revealed { opacity: 1; transform: translateY(0); }

/* ── Floating WhatsApp Widget ── */
.whatsapp-float {
    position: fixed; width: 60px; height: 60px; bottom: 40px; right: 40px;
    background-color: #25d366; color: #fff; border-radius: 50px;
    text-align: center; font-size: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 999; display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
    will-change: transform; text-decoration: none;
}
.whatsapp-float:hover { transform: scale(1.1) rotate(5deg); background-color: #20ba5a; box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4); }
.whatsapp-float .tooltip-text {
    visibility: hidden; width: 120px; background-color: #333; color: #fff;
    text-align: center; border-radius: 6px; padding: 5px 0;
    position: absolute; z-index: 1001; right: 125%; font-size: 0.8rem;
    font-family: var(--font-body); font-weight: 500; opacity: 0;
    transition: opacity 0.3s; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.whatsapp-float:hover .tooltip-text { visibility: visible; opacity: 1; }

/* ── Responsive Breakpoints ── */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem; }
    .footer-company { grid-column: span 2; }
    
    /* Menu moved to tablet breakpoint to prevent overlapping */
    .mobile-toggle { display: flex; }
    .nav-menu {
        position: fixed; top: 80px; left: -100%; width: 100%;
        height: calc(100vh - 80px); background-color: var(--bg-secondary);
        flex-direction: column; padding: 3rem 2rem; gap: 2rem;
        transition: left 0.4s ease; border-top: 1px solid var(--border-color);
        overflow-y: auto;
    }
    .nav-menu.open { left: 0; }
    .mobile-toggle.active .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .mobile-toggle.active .bar:nth-child(2) { opacity: 0; }
    .mobile-toggle.active .bar:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }
}
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; gap: 2.5rem; }
    .whatsapp-float { width: 50px; height: 50px; bottom: 20px; right: 20px; font-size: 24px; }
}
@media (max-width: 580px) {
    .grid-3 { grid-template-columns: 1fr; }
}

/* ── Skip Navigation (Accessibility) ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background-color: var(--accent-color);
    color: hsl(220, 30%, 10%);
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    font-weight: 700;
    font-family: var(--font-heading);
    z-index: 10000;
    transition: top 0.3s ease;
}
.skip-link:focus {
    top: 0;
}

/* ── Reduced Motion Preference (WCAG 2.1 AAA) ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    html { scroll-behavior: auto; }
    .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
