/*
  Emapot - Premium Industrial Engineering Design
  author: emapot
*/

:root {
    --primary-blue: #0056b3;
    --secondary-blue: #004494;
    --deep-gray: #1a1a1a;
    --accent-blue: #0099ff;

    /* Light Theme Variables */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-section: #f9f9f9;
    --text-main: #2d2d2d;
    --text-muted: #666666;
    --text-light: #ffffff;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --header-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.05);

    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
    --transition-smooth: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --header-height-scrolled: 112px;
}

/* Dark Mode Overrides */
body.dark-mode {
    --bg-primary: #1b3a5b;    /* Light blue from sample image */
    --bg-secondary: #122a4a;  /* Slightly darker for cards */
    --bg-section: #163150;    /* Intermediate for sections */
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --card-bg: #122a4a;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --header-bg: rgba(4, 28, 50, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
    --deep-gray: #041c32;     /* Dark blue from sample image */
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode .process-step span {
    color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-padding-top: var(--header-height-scrolled);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--deep-gray);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 0;
    z-index: 1000;
    transition: var(--transition-smooth);
}

.hamburger {
    display: none;
}

header.scrolled {
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 65px;
    width: auto;
    transition: var(--transition-smooth);
}

header.scrolled .logo img {
    height: 50px;
}

.nav-links {
    display: flex;
    gap: 50px;
    align-items: center;
}

.nav-link {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    color: var(--text-light);
    opacity: 0.9;
}

header.scrolled .nav-link {
    color: var(--text-main);
    opacity: 1;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: var(--transition-smooth);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--accent-blue);
    opacity: 1;
}

header.scrolled .nav-link:hover,
.nav-link.active {
    color: var(--accent-blue);
    opacity: 1;
}

header.scrolled .nav-link.active {
    color: var(--primary-blue);
}

.nav-link.active img {
    filter: invert(47%) sepia(87%) saturate(2500%) hue-rotate(178deg) brightness(102%) contrast(106%) !important;
}

.home-icon-link {
    display: inline-flex;
    align-items: center;
    padding: 0;
}
.home-icon-link img {
    height: 24px;
    width: auto;
    transition: var(--transition-smooth);
}
.home-icon-default {
    display: block;
}
.home-icon-scrolled {
    display: none;
}
header.scrolled .home-icon-default {
    display: none;
}
header.scrolled .home-icon-scrolled {
    display: block;
}
.home-icon-link::after {
    display: none !important;
}
.home-icon-link:hover img {
    transform: scale(1.15);
}

body.dark-mode .home-icon-scrolled {
    filter: brightness(0) invert(1);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    color: #000000;
}
.theme-toggle svg {
    width: 24px;
    height: 24px;
}

.sun-icon { display: none; }
.moon-icon { display: block; }

.theme-toggle img {
    height: 24px;
    width: auto;
    transition: var(--transition-smooth);
}

.theme-toggle:hover {
    transform: rotate(30deg) scale(1.1);
}

body.dark-mode .sun-icon { display: block; }
body.dark-mode .moon-icon { display: none; }

body.dark-mode .theme-toggle {
    color: #ffffff !important; /* White for dark mode */
}
body.dark-mode .process-step span {
    color: #ffffff;
}


/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    overflow: hidden;
    /* Initial state: deep blue gradient as seen in screenshot */
    background: linear-gradient(135deg, #041c32 0%, #063970 100%);
    z-index: 0;
}

/* Subpage hero adjustments to prevent header overlap */
.sub-page .hero {
    padding-top: calc(var(--header-height-scrolled) + 40px);
    min-height: 400px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0; /* Hidden initially */
transition: opacity 3s cubic-bezier(0.4, 0, 0.2, 1); /* 3s smooth blend */
    transform: scale(1.05);
    animation: zoomHero 20s infinite alternate;
}
.hero-bg.fade-in {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.7), rgba(0, 86, 179, 0.3));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes zoomHero {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero .highlight-blue {
    color: #00ccff;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: var(--primary-blue);
    color: #fff;
    padding: 16px 40px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.3);
    transition: var(--transition-smooth);
}

.cta-button:hover {
    background: var(--secondary-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 86, 179, 0.4);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0.8;
    transition: var(--transition-smooth);
}
.scroll-indicator:hover {
    opacity: 1;
}
.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid #fff;
    border-radius: 14px;
    position: relative;
    margin-bottom: 5px;
}
.wheel {
    width: 4px;
    height: 8px;
    background: #fff;
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}
.arrows span {
    display: block;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: rotate(45deg);
    margin: -3px auto;
    animation: scrollArrows 2s infinite;
}
.arrows span:nth-child(2) { animation-delay: -0.2s; }
.arrows span:nth-child(3) { animation-delay: -0.4s; }

@keyframes scrollWheel {
    0% { top: 6px; opacity: 1; }
    100% { top: 20px; opacity: 0; }
}
@keyframes scrollArrows {
    0% { opacity: 0; transform: rotate(45deg) translate(-5px, -5px); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: rotate(45deg) translate(5px, 5px); }
}

/* Grant Badge */
#main-header.scrolled {
    background: var(--header-bg) !important;
}

.hero-grants-badge {
    position: fixed;
    bottom: 0px;
    right: 0px;
    width: 176px;
    max-width: 176px;
    cursor: pointer;
    z-index: 1100;
    transition: var(--transition-smooth);
    opacity: 1 !important;
    animation: fadeInUp 1.2s forwards 0.5s;
    background: transparent !important;
    pointer-events: auto;
    overflow: visible;
}

.hero-grants-badge img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-grants-badge:hover {
    transform: translateY(-5px) scale(1.02);
}

@media (max-width: 991px) {
    .hero-grants-badge {
        display: none !important;
    }
}

/* Sections */
section {
    padding: 120px 0;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 60px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-blue);
    margin: 20px auto 0;
}

/* Detail Rows */
.detail-row {
    display: flex;
    align-items: center;
    gap: 80px;
    margin-top: 50px;
}

.detail-row.reverse {
    flex-direction: row-reverse;
}

.detail-text {
    flex: 1;
}

.detail-text h2 {
    font-size: 2.5rem;
    margin-bottom: 25px;
    color: var(--primary-blue);
}

.detail-text p {
    font-size: 1.15rem;
    margin-bottom: 30px;
    color: var(--text-muted);
}

.detail-image {
    flex: 1;
    cursor: pointer;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-smooth);
}

.detail-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.detail-image img {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    display: block;
    width: 100%;
    height: auto;
}

/* Check List */
.check-list {
    list-style: none;
    margin-top: 25px;
}

.check-list li {
    padding: 10px 0;
    padding-left: 35px;
    position: relative;
    font-weight: 500;
    font-size: 1.05rem;
}

.check-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 1.2rem;
}

/* Responsive detail rows */
@media (max-width: 991px) {
    .detail-row,
    .detail-row.reverse {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .detail-text,
    .detail-image {
        width: 100%;
    }
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    position: relative;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    height: 250px;
    background-size: cover;
    background-position: center;
}

.card-content {
    padding: 30px;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.card-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.read-more {
    font-weight: 600;
    color: var(--primary-blue);
    display: inline-flex;
    align-items: center;
    transition: var(--transition-smooth);
}

.read-more:hover {
    color: var(--secondary-blue);
    padding-left: 5px;
}

.read-more::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
}

/* Glassmorphism Icon Containers */
.icon-grid {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    margin-top: 50px;
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.process-step span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--deep-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.icon-box {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 2px solid var(--primary-blue);
    border-radius: 50%;
    transition: var(--transition-smooth);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden; /* Ensure anything outside stays inside the circle */
}

.icon-box img {
    width: 70%; /* Perfect size for minimal icons */
    height: auto;
    object-fit: contain;
    transition: var(--transition-smooth);
    /* High contrast helps push "off-white" backgrounds to pure white, which multiply then makes invisible */
    filter: brightness(1.05) contrast(1.2);
    mix-blend-mode: multiply; 
}

body.dark-mode .icon-box img {
    /* Similarly push inverted background to pure black */
    filter: invert(1) hue-rotate(180deg) brightness(1.2) contrast(200%);
    mix-blend-mode: screen; 
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-secondary);
    width: 90%;
    max-width: 800px;
    padding: 50px;
    border-radius: 12px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: var(--text-dark);
}

/* Contact Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-main);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.submit-btn {
    width: 100%;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.submit-btn:hover {
    background: var(--secondary-blue);
}

/* Footer */
footer {
    background: var(--deep-gray);
    color: rgba(255, 255, 255, 0.7);
    padding: 80px 0 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    margin-bottom: 50px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 25px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        transition: var(--transition-smooth);
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        color: var(--deep-gray) !important;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        z-index: 1001;
    }

    .hamburger span {
        display: block;
        width: 30px;
        height: 3px;
        background: var(--text-light);
        transition: var(--transition-smooth);
    }

    header.scrolled .hamburger span {
        background: var(--deep-gray);
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .hamburger.active span {
        background: var(--deep-gray) !important;
    }
}

/* Language Selector */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-dropdown { position: relative; }

.lang-active {
    display: none;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 5px;
    display: inline-block;
    vertical-align: middle;
}

.lang-options {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-options-old {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.lang-flag {
    width: 25px;
    height: 18px;
    object-fit: contain;
    cursor: pointer;
    border-radius: 2px;
    transition: var(--transition-smooth);
}

.lang-flag:hover {
    transform: scale(1.1);
}

/* Contact Page Styles */
.contact-container {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr;
    gap: 80px;
    margin-top: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.info-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.info-icon {
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
}

.info-text h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary-blue);
}

.info-text p, .info-text a {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.legal-info {
    margin-top: 20px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.legal-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.maps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 80px;
}

.map-wrapper {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.map-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.map-label {
    margin-bottom: 15px;
    font-weight: 700;
    color: var(--deep-gray);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

@media (max-width: 991px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    .maps-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 991px) {
    .lang-active {
        display: flex;
    }

    .lang-options {
        display: none;
        position: absolute;
        top: 130%;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 12px;
        border-radius: 8px;
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--border-color);
        z-index: 1100;
        min-width: 50px;
        gap: 12px;
    }

    .lang-dropdown.active .lang-options {
        display: flex;
        animation: fadeInDown 0.3s ease forwards;
    }

    @keyframes fadeInDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (max-width: 768px) {
    .modal-content {
        padding: 40px 15px 30px;
        width: 94%;
    }
}
