*, *::before, *::after {
    box-sizing: border-box;
}

/* =======================================
   A. GLOBAL STYLES & SMOOTH SCROLLING
   ======================================= */

/* A: Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* B: Base Font and Color Definitions */
:root {
    --color-background: #0d0d0d; /* Dark Background */
    --color-background-secondary: #1c1c1c; /* B: NEW: For article cards & distinct dark elements */
    --color-text-primary: #ffffff; /* White Text */
    --color-text-secondary: #aaaaaa; /* Lighter/Muted Text */
    --color-accent-green: #00ff66; /* Bright Green Accent */
    --color-accent-blue: #00ccff; /* Bright Blue Accent (for gradient) */
    --color-card-background: #fff; /* White Card Background (used for How It Works section) */
    --color-card-text: #0d0d0d; /* Dark Text for Cards */

    --font-heading: 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Arial', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    line-height: 1.1;
    margin-bottom: 0.5em;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }

p {
    margin-bottom: 1em;
    color: var(--color-text-secondary);
}

a {
    text-decoration: none;
    color: var(--color-accent-green);
    /* C: Hover Effect */
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-accent-blue);
}

/* =======================================
   HEADER & NAVIGATION (Sticky Header)
   ======================================= */

/* C: Sticky Header */
.site-header {
    background-color: var(--color-background);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo a {
    color: var(--color-text-primary);
    line-height: 1;
}

.logo h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    font-weight: bold;
}

.logo-subtext {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin: 0;
}

.primary-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.primary-navigation a {
    color: var(--color-text-primary);
    font-weight: 500;
}

.primary-navigation a.active {
    color: var(--color-accent-green); /* B: Active Link Color */
}

/* C: Mobile Menu Toggle (hidden on desktop) */
.mobile-menu-toggle {
    display: none; 
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-text-primary);
}

/* =======================================
   HERO SECTION
   ======================================= */

.hero-section {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.hero-background-overlay {
    /* D: Placeholder for image */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(13, 13, 13, 0.8), rgba(13, 13, 13, 0.9)), url('placeholder-background.jpg') no-repeat center center/cover; 
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-text {
    max-width: 700px;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem); /* Responsive Heading Size */
}

.hero-text p {
    font-size: 1.25rem;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

/* B: Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    /* B: Primary Button Color */
    background: linear-gradient(90deg, #00ff66, #00ccff);
    border-color: transparent;
    color: var(--color-background);
}

.btn-secondary {
    /* B: Secondary Button Color */
    background-color: transparent;
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
}

/* C: Hover Effect for Buttons */
.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 0 10px var(--color-accent-green);
}

.btn-secondary:hover {
    background-color: var(--color-text-primary);
    color: var(--color-background);
}

/* D: Gradient Visual (Energy Bar) */
.hero-gradient-visual {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 100%;
    background: linear-gradient(to top, var(--color-accent-blue), var(--color-accent-green));
    z-index: 0;
}

.sector-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.pill {
    /* B: Pill/Tag Style */
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-text-secondary);
    color: var(--color-text-primary);
    font-size: 0.9rem;
    border-radius: 20px;
    background-color: transparent;
}

.pill:hover {
    border-color: var(--color-accent-green);
    color: var(--color-accent-green);
}


/* =======================================
   HOW IT WORKS SECTION
   ======================================= */

.how-it-works {
    padding: 4rem 0;
}

.how-it-works h2 {
    margin-bottom: 2rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    /* B: Card Styling - NOW USING GRADIENT */
    background: linear-gradient(90deg, var(--color-accent-green), var(--color-accent-blue));
    /* Text color for contrast */
    color: var(--color-background); 
    padding: 2rem;
    border-radius: 8px;
    /* Darker shadow for better lift on dark background */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); 
    /* C: Hover Effect */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0.87;
}

.card:hover {
    transform: translateY(-5px);
    /* Subtle glow on hover */
    box-shadow: 0 8px 20px rgba(0, 255, 102, 0.5);
}

.card-icon {
    /* D: Icon placeholder style */
    font-size: 3rem;
    /* Icon color set to dark for contrast */
    color: var(--color-background); 
    margin-bottom: 0.5rem;
}

.card h3 {
    /* Heading text set to dark */
    color: var(--color-background); 
    margin-bottom: 0.5rem;
}

.card p {
    /* Paragraph text set to slightly lighter dark color */
    color: #444; 
}

/* =======================================
   ABOUT PAGE MODIFIERS
   ======================================= */

/* Specific modifier for the 4-card grid on the About page */
.card-grid.four-col-grid {
    grid-template-columns: repeat(4, 1fr); /* Default 4 columns */
}

/* Tablet view: 2 columns */
@media (max-width: 992px) {
    .card-grid.four-col-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile view: 1 column */
@media (max-width: 576px) {
    .card-grid.four-col-grid {
        grid-template-columns: 1fr;
    }
}

.about-hero-section {
    padding: 6rem 0; /* Ensures consistent vertical spacing */
}

.lead-paragraph {
    font-size: 1.25rem;
}

/* =======================================
   CALCULATOR STYLES
   ======================================= */

.calculator-section {
    padding: 6rem 0;
    text-align: center;
}

.calculator-content {
    max-width: 600px; /* B: Confines the form content to a center column */
    margin: 0 auto;
}

.page-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

.calculator-icon {
    /* D: Icon placeholder style */
    font-size: 5rem;
    color: var(--color-accent-green);
    margin: 2rem 0 0.5rem;
}

.intro-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.calculator-form {
    text-align: left;
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.dark-input {
    /* Styles for the input box */
    width: 100%;
    padding: 1rem;
    background-color: transparent;
    border: 2px solid var(--color-text-secondary); /* B: Input border color */
    color: var(--color-text-primary);
    border-radius: 5px;
    font-size: 1.25rem;
    /* C: Hover/Focus Effect */
    transition: border-color 0.3s ease;
}

.dark-input:focus {
    outline: none;
    border-color: var(--color-accent-green);
}

.dark-input::placeholder {
    color: var(--color-text-secondary);
}

.calculate-btn {
    width: 100%;
    font-size: 1.5rem;
    padding: 1rem 0;
    text-align: center;
    /* B: Primary Button Styling reused */
}

.result-display {
    /* C: Styling for where the calculation result will show */
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--color-accent-green);
    border-radius: 5px;
    text-align: center;
    font-size: 1.25rem;
    color: var(--color-accent-green);
    display: none; /* C: Initially hidden, shown by JS after calculation */
}

/* =======================================
   SECTOR DETAIL STYLES
   ======================================= */

.sector-detail-section {
    padding: 6rem 0;
}

.sector-content {
    max-width: 800px; /* B: Confines content for better readability */
    margin: 0 auto;
}

.sector-main-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 2rem;
    color: var(--color-text-primary);
}

.sector-icon {
    /* D: Icon placeholder style */
    font-size: 5rem;
    color: var(--color-accent-green);
    margin: 2rem 0;
    line-height: 1; /* Ensures icon is centered visually */
}

.sector-sub-block {
    margin-bottom: 4rem;
}

.sub-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.sub-title-large {
    /* Larger, bold text for the second main point */
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    color: var(--color-text-primary);
    margin-top: 2rem;
}

.intro-text, .sub-text-2 {
    font-size: 1.15rem;
    line-height: 1.7;
    max-width: 700px;
}

/* =======================================
   C. SECTOR CAROUSEL STYLES 
   ======================================= */

.sector-diagram-placeholder {
    /* Replaces the dashed line placeholder styles */
    margin-top: 2rem;
    position: relative;
    overflow: hidden; /* IMPORTANT: Hides images that are not currently visible */
    border-radius: 8px; 
    box-shadow: 0 0 20px rgba(0, 255, 102, 0.2); /* B: Optional: Adds a subtle glow */
}

.image-slider {
    width: 100%;
    height: 350px; /* B: Adjust this height to fit your images */
    position: relative;
}

.slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* D: Ensures images fill the container without distortion */
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0; /* Hidden by default */
    /* C: Smooth transition for fade effect */
    transition: opacity 1s ease-in-out; 
}

.slider-image.active-slide {
    opacity: 1; /* Only the active image is visible */
}

/* Mobile adjustment */
@media (max-width: 768px) {
    .image-slider {
        height: 250px; /* Smaller height on mobile */
    }
}

/* --- Modern Styling Variables --- */
:root {
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-glow: rgba(0, 212, 255, 0.3);
    --text-gradient: linear-gradient(90deg, #fff, #00d4ff);
}

/* --- Layout Enhancements --- */
.gradient-text {
    background: var(--text-gradient);
    
    /* Compatibility & Standards */
    -webkit-background-clip: text;  /* For Safari and Chrome */
    background-clip: text;         /* Standard property */
    
    /* Text Fill */
    -webkit-text-fill-color: transparent; 
    color: transparent;            /* Fallback to ensure text stays transparent */
    
    font-weight: 800;
}

.video-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
    z-index: -1;
}

.sector-badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: var(--color-accent-blue);
    border-radius: 50px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

/* --- Image Hover Effects & Scaling Fix --- */
.image-wrapper {
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    /* Ensure the wrapper itself has a defined height to prevent jumping */
    height: 370px; 
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.1); /* Subtle background for transparency */
}

.image-wrapper img {
    /* These properties are the key to stopping the crop */
    width: 100%;
    height: 100%;
    object-fit: contain; /* Shows the WHOLE image without cutting it off */
    
    transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.image-wrapper:hover img {
    transform: scale(1.05); /* Slight zoom on hover */
}

/* Mobile Adjustment to prevent the container from being too tall */
@media (max-width: 768px) {
    .image-wrapper {
        height: auto; /* Let the height be determined by the image on phones */
        min-height: 200px;
    }
}

/* --- Glassmorphism Cards --- */
.glass-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--accent-glow);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

/* --- CTA Panel --- */
.glass-panel {
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(0,0,0,0.8));
    padding: 4rem;
    border-radius: 30px;
    border: 1px solid var(--color-accent-blue);
    text-align: center;
}

.btn-glow:hover {
    box-shadow: 0 0 20px var(--color-accent-blue);
}

/* --- Reveal Animations --- */
[class*="reveal-"] {
    opacity: 0;
    transition: all 1s ease-out;
}

.reveal-left { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }

/* This class will be added via JS when the user scrolls */
.active-reveal {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* =======================================
   D. ICON IMAGES FIX (Applies to sector-landing icons and large sector page icons)
   ======================================= */

/* Ensures the image scales down to fit the container and is centered */
.card-icon img,
.sector-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures the image fits within the bounding box without cropping */
    display: block;
    max-width: 475px; /* B: You can adjust this to ensure icons aren't too large */
    max-height: 475px;
    margin: 0 auto; /* Centers the image inside the flex/block container */
}

.sector-icon img {
    max-width: 470px; /* Larger size for the main icon on detail pages */
    max-height: 470px;
}

/* =======================================
   EVENTS/NEWS STYLES
   ======================================= */

.events-section {
    padding: 6rem 0;
}

.article-grid {
    display: grid;
    /* B: Two-column layout for desktop, columns will wrap on smaller screens */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 3rem; 
}

.article-card {
    background-color: var(--color-background-secondary);
    border-radius: 8px;
    overflow: hidden; /* Keeps the image placeholder edges clean */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px); /* C: Subtle lift on hover */
    box-shadow: 0 10px 20px rgba(0, 255, 102, 0.2);
}

.article-image-placeholder {
    height: 200px;
    width: 100%;
    /* D: Placeholder styles - replace with actual image tags */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.article-content {
    padding: 1.5rem;
}

.article-content h3 {
    font-size: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-primary);
}

.article-date {
    display: block;
    font-size: 0.9rem;
    color: var(--color-accent-green);
    font-weight: bold;
    margin-bottom: 0.75rem;
}

.article-category {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* Category Color Coding */
.category-project {
    background-color: var(--color-accent-blue);
    color: var(--color-background);
}
.category-award {
    background-color: var(--color-accent-green);
    color: var(--color-background);
}
.category-social {
    background-color: #8a2be2; /* Violet */
    color: white;
}
.category-achievement {
    background-color: #ffc107; /* Yellow */
    color: var(--color-background);
}

.read-more {
    display: block;
    margin-top: 1rem;
    color: var(--color-accent-green);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #ccff00; /* Lighter green on hover */
}

/* =======================================
   MODAL (FULL-PAGE POPUP) STYLES
   ======================================= */

.modal-overlay {
    display: none; /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* B: Almost opaque dark background */
    background-color: rgba(13, 13, 13, 1);/* Fixed value: 0 to 1 range */
    z-index: 1000; /* Ensure it's above everything */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.open {
    /* C: State when open */
    display: block;
    opacity: 1;
    visibility: visible;
    overflow-y: auto; /* Allows scrolling within the modal content */
}

.modal-content-wrapper {
    position: relative;
    width: 100%;
    min-height: 100%;
}

.modal-article-scroll-container {
    padding: 6rem 0 4rem; /* Padding for the content inside the modal */
}

/* X Close Button Style */
.modal-close-btn {
    position: fixed;
    top: 30px;
    right: 40px;
    color: var(--color-accent-green);
    background: none;
    border: 2px solid var(--color-accent-green);
    font-size: 2rem;
    line-height: 1;
    padding: 10px 18px;
    cursor: pointer;
    z-index: 1001; /* Above all modal content */
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.modal-close-btn:hover {
    background-color: var(--color-accent-green);
    color: var(--color-background);
}

/* Reuses existing article detail layout styles */
.modal-article-scroll-container .article-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Modal Slider Container */
#modalFeaturedImage .image-slider {
    width: 100%;
    height: 400px; /* Set your desired height for the modal image */
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

#modalFeaturedImage .slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Prevents stretching */
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

#modalFeaturedImage .slider-image.active-slide {
    opacity: 1;
}

/* =======================================
   VIDEO BACKGROUND STYLES
   ======================================= */

.video-background {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -10; /* Puts the video behind everything */
    overflow: hidden;
}

.video-background video {
    /* Ensures the video covers the entire viewport */
    min-width: 100%; 
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Dims and desaturates the video to keep focus on foreground content */
    filter: brightness(0.7) grayscale(77%); 
    opacity: 0.7; 
}

/* 2. ADD A PERMANENT DARK OVERLAY for better text contrast */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use a semi-transparent black overlay to deepen the background */
    background-color: rgba(13, 13, 13, 0.7); /* Adjust the 0.6 opacity to control the dark theme depth */
    z-index: -9; /* Placed between the content (header, main) and the video */
}

/* =======================================
   CONTACT STYLES
   ======================================= */

.contact-section {
    padding: 6rem 0;
    text-align: center;
}

.contact-content {
    max-width: 700px; /* B: Slightly wider form area */
    margin: 0 auto;
}

.contact-form {
    text-align: left;
    margin-top: 2rem;
}

/* Ensure textarea also uses the dark-input styles */
.contact-form textarea.dark-input {
    resize: vertical; /* Allows users to resize vertically */
}

/* Reusing .form-group and .dark-input from calculator styles */

.contact-btn {
    width: 100%;
    font-size: 1.25rem;
    padding: 1rem 0;
}

/* C: Message status box styling */
.form-message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 5px;
    text-align: center;
    font-size: 1rem;
    color: var(--color-text-primary);
    border: 1px solid transparent;
    display: none; /* C: Initially hidden, shown by JS after submission */
}

.form-message.success {
    background-color: rgba(0, 255, 102, 0.1); /* Light green background */
    border-color: var(--color-accent-green);
    color: var(--color-accent-green);
}

.form-message.error {
    background-color: rgba(255, 0, 0, 0.1); /* Light red background */
    border-color: #ff0000;
    color: #ff0000;
}

/* =======================================
   FOOTER
   ======================================= */

footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* =======================================
   A. RESPONSIVENESS (Media Queries)
   ======================================= */

/* 1. Desktop Styles (Hidden elements) */
.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 2000;
}

.bar {
    width: 30px;
    height: 3px;
    background-color: var(--color-accent-green);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 2. Tablet & Smaller Screens */
@media (max-width: 1024px) {
    .hero-content { padding: 0 1rem; }
}

/* 3. Mobile Screens (768px and below) */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex; /* Show hamburger icon */
    }

    /* THE SLIDE-OUT MENU LOGIC */
    .primary-navigation ul {
        position: fixed;
        top: 0;
        right: -100%; 
        width: 75%;
        height: 100vh;
        background-color: var(--color-background-secondary);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        z-index: 1050;
    }

    .primary-navigation ul.nav-active {
        right: 0; 
    }

    /* --- FIX FOR HERO GRADIENT VISUAL --- */
    .hero-gradient-visual {
        width: 12px;      /* Make the energy bar much thinner */
        right: -8px;         /* Stick it to the very edge */
    }

    .hero-text {
        padding-right: 25px; /* Create a 'buffer' so text never hits the bar */
        max-width: 100%;
    }

    /* General Layout Adjustments */
    .hero-text h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .container { width: 92%; }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }
    .btn { width: 100%; text-align: center; }

    .card-grid { grid-template-columns: 1fr; }

    /* Fix image height for small screens */
    .image-wrapper.small {
        height: 250px; 
    }
}

/* Ensure the result container is visible */
.result-display {
    display: block !important; 
    margin-top: 2rem;
}

/* Styled Result Card */
.result-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-accent-green);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 255, 102, 0.1);
    animation: fadeInUp 0.6s ease forwards;
}

.main-stat {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-accent-green);
    margin: 1rem 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- UI Toggle Logic --- */

/* This class hides elements by default */
.hidden {
    display: none !important;
}

/* Optional: Smooth entry animation for when inputs appear */
.sector-inputs {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Themed Dropdown Styles --- */

/* Targets the main select box */
#sectorSelect.dark-input {
    background-color: rgba(13, 13, 13, 0.8); /* Match your background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-accent-green);
    color: var(--color-text-primary);
    cursor: pointer;
    appearance: none; /* Removes default browser arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300ff66' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 20px) center;
    padding-right: 40px; /* Space for the custom arrow */
}

/* Targets the dropdown list (Options) */
#sectorSelect option {
    background-color: var(--color-background-secondary); /* Solid dark color */
    color: var(--color-text-primary);
    padding: 10px;
}

/* Style for when the dropdown is focused */
#sectorSelect:focus {
    border-color: var(--color-accent-blue);
    box-shadow: 0 0 15px rgba(0, 204, 255, 0.3);
}

/* Ensure labels also follow the theme */
.select-group label {
    color: var(--color-accent-green);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem !important;
    margin-bottom: 10px;
}

/* --- Input Focus & Glow Effects --- */

/* Targets both the inputs and the select box when clicked */
.dark-input:focus {
    outline: none;
    border-color: var(--color-accent-blue) !important;
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.2), 
                inset 0 0 10px rgba(0, 204, 255, 0.1);
    transform: translateY(-2px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhancing the number inputs specifically */
input[type="number"].dark-input {
    font-family: 'Courier New', monospace; /* Gives a "data/tech" feel */
    letter-spacing: 1px;
}

/* Styling the Placeholder text to be more subtle */
.dark-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

/* --- Calculation Result Card Enhancement --- */
.result-card {
    background: linear-gradient(145deg, rgba(0, 255, 102, 0.1), rgba(0, 204, 255, 0.05));
    border: 1px solid var(--color-accent-green);
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

/* Subtle "Scanning" animation for the result */
.result-card::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 102, 0.05), transparent);
    animation: scan 3s infinite linear;
}

@keyframes scan {
    0% { top: -100%; }
    100% { top: 100%; }
}

/* =======================================
   MOBILE-FRIENDLY CALCULATOR OVERRIDES
   ======================================= */

@media (max-width: 768px) {
    /* 1. Adjust the Main Container */
    .calculator-content.glass-panel {
        padding: 2rem 1.5rem; /* Reduced padding for more screen space */
        width: 95%;
        border-radius: 15px;
    }

    .calculator-section {
        padding: 3rem 0; /* Less vertical space on mobile */
    }

    /* 2. Fix Text Sizes */
    .page-title {
        font-size: 1.8rem; /* Scaled down for mobile */
        margin-bottom: 1.5rem;
    }

    .form-group label {
        font-size: 1.1rem; /* Easier to read on small screens */
    }

    /* 3. Optimize Inputs for Touch */
    .dark-input {
        font-size: 16px !important; /* Forces 16px to prevent iOS auto-zoom */
        padding: 0.8rem;
        margin-bottom: 1rem;
    }

    /* 4. Result Card Adjustments */
    .main-stat {
        font-size: 2.2rem; /* Prevent text wrapping/clipping */
    }

    .result-card {
        padding: 1.5rem;
    }

    /* 5. Handle Video Background on Mobile */
    /* Some mobile browsers struggle with heavy video filters */
    .video-background video {
        display: block; /* Ensure it stays visible */
        object-fit: cover;
    }
}

/* Fix for very small screens (iPhone SE, etc.) */
@media (max-width: 380px) {
    .main-stat {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
    }
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(13, 13, 13, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-accent-green);
    color: var(--color-accent-green);
    border-radius: 50%;
    cursor: pointer;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 2000;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.2);
}

.back-to-top:hover {
    background: var(--color-accent-green);
    color: var(--color-background);
    box-shadow: 0 0 25px var(--color-accent-green);
    transform: translateY(-5px);
}

/* On mobile, make it slightly larger for thumbs */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}

.form-status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

/* Simple CSS Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Styling for the new dropdown */
.dropdown-select {
    appearance: none; /* Removes default browser arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
    cursor: pointer;
}

.dropdown-select option {
    background-color: #1a1a1a; /* Matches your dark theme */
    color: white;
}

/* Responsive Form Elements */
.contact-form, .calculator-form {
    width: 100%;
    max-width: 100%; /* Prevents horizontal overflow */
}

.dark-input, .dropdown-select {
    width: 100%; /* Ensures it fills the container */
    max-width: 100%;
    box-sizing: border-box; /* Crucial: includes padding in the width calculation */
    padding: 12px 15px;
    font-size: 16px; /* Prevents iOS from auto-zooming on focus */
}

/* Adjusting the dropdown specifically for mobile */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .page-title {
        font-size: 1.8rem; /* Scaled down for mobile */
    }

    /* Ensure the icon/arrow in the dropdown doesn't overlap text on small screens */
    .dropdown-select {
        padding-right: 2rem;
        text-overflow: ellipsis; /* Cuts off long text gracefully */
    }
}

/* =======================================
   FINAL RESPONSIVE FORM FIX
   ======================================= */

/* 1. Ensure the parent containers don't overflow */
.contact-form, 
.calculator-form, 
.sector-inputs,
.contact-content,
.calculator-content {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden; /* Prevents children from sticking out */
}

/* 2. Force inputs and selects to stay inside the container */
.dark-input, 
.dropdown-select, 
select.dark-input,
textarea.dark-input {
    width: 100% !important; 
    max-width: 100% !important;
    box-sizing: border-box !important; /* Critical: forces padding INSIDE the width */
    display: block;
    margin-left: 0;
    margin-right: 0;
}

/* 3. Mobile-specific sizing adjustments */
@media (max-width: 768px) {
    .form-group {
        width: 100% !important;
        margin-bottom: 1.5rem;
    }

    /* Standardizes touch targets and prevents the iOS auto-zoom bug */
    .dark-input, 
    .dropdown-select {
        font-size: 16px !important; 
        padding: 0.8rem !important;
    }

    /* Allows labels to wrap instead of stretching the screen */
    .form-group label {
        font-size: 1.1rem !important;
        white-space: normal; 
        line-height: 1.3;
    }
    
    /* Ensures the video background doesn't interfere with form width */
    .container {
        width: 95%;
        padding: 0 10px;
    }
}

.intro-text {
    text-align: center;
    max-width: 700px; /* Keeps line length readable */
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Enhanced Contact Icon */
.contact-header-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem; /* More space above the text */
}

.icon-circle {
    width: 100px;  /* Increased from 80px */
    height: 100px; /* Increased from 80px */
    font-size: 4rem; /* Makes the 📩 much larger */
    background: rgba(0, 255, 102, 0.05);
    border: 2px solid var(--color-accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(0, 255, 102, 0.3);
    
    /* Subtle breathing animation */
    animation: iconPulse 3s infinite ease-in-out;
}

@keyframes iconPulse {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(0, 255, 102, 0.2); }
    50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(0, 255, 102, 0.4); }
    100% { transform: scale(1); box-shadow: 0 0 20px rgba(0, 255, 102, 0.2); }
}

.contact-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent-blue), transparent);
    width: 60%;
    margin: 1.5rem auto 2.5rem;
    opacity: 0.6;
}

/* Ensure the intro text remains centered */
.intro-text {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    color: var(--color-text-secondary);
}

/* CTA Section Responsive Adjustments */
.cta-section .glass-panel {
    text-align: center;
    padding: 3rem 1.5rem;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap; /* Allows buttons to drop to next line if needed */
}

/* Mobile Specific (Screens smaller than 768px) */
@media (max-width: 768px) {
    .cta-buttons {
        flex-direction: column; /* Stacks buttons vertically */
        align-items: center;
    }

    .cta-buttons .btn {
        width: 100%; /* Makes buttons full-width for easy tapping */
        max-width: 300px; /* Prevents them from getting too wide */
        margin: 0;
    }
    
    .cta-section h2.sub-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
}

/* --- MOBILE LAYOUT SPACING FIXES --- */
@media (max-width: 768px) {
    
    /* 1. Fix the overlap with the section ABOVE (IoT Card) */
    .cta-section {
        margin-top: 40px !important; /* Forces space at the top */
        margin-bottom: 40px !important; /* Forces space at the bottom */
        padding-top: 20px !important;
        padding-bottom: 20px !important;
        display: block !important;
        clear: both !important;
    }

    /* 2. Fix the overlap with the FOOTER */
    footer {
        margin-top: 50px !important; /* Pushes footer away from the CTA */
        padding: 30px 0 !important;
        position: relative !important;
        z-index: 10;
        background: rgba(0, 0, 0, 0.8); /* Ensures footer has a solid base */
    }

    /* 3. Ensure the glass panel inside expands to fit content */
    .cta-section .glass-panel {
        height: auto !important; /* Prevents fixed heights from cutting content */
        min-height: min-content;
        padding: 2.5rem 1rem !important;
        margin-bottom: 20px !important;
    }

    /* 4. Fix heading line-height so it doesn't bleed into buttons */
    .cta-section h2.sub-title {
        margin-bottom: 1.5rem !important;
        line-height: 1.4 !important;
    }
}

/* --- FIX GRID OVERLAP WITH IMAGE --- */
@media (max-width: 768px) {
    /* 1. Ensure the section with the image has space at the bottom */
    .section-padding {
        padding-bottom: 2rem !important;
         padding-top: 1rem !important;
    }

    /* 2. Fix the Grid spacing */
    .glass-card-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
        margin-top: 2rem !important; /* Forces the grid down away from the image */
        padding-top: 0 !important;
    }

    /* 3. Ensure the first card doesn't have an upward pull */
    .glass-card:first-child {
        margin-top: 0 !important;
    }

    /* 4. Fix any images above the grid that might be floating */
    .container img, 
    .hero-image,
    .sector-header-image {
        margin-bottom: 0rem !important;
        display: block !important;
        position: relative !important;
    }
}

/* --- MOVE MOBILE MENU TO THE RIGHT --- */
@media (max-width: 768px) {
    .header-content {
        display: flex !important;
        justify-content: space-between !important; /* Pushes logo left and button right */
        align-items: center !important;
        width: 100% !important;
        padding: 0 20px !important; /* Ensures it doesn't touch the very edge of the glass */
    }

    #mobileMenuBtn {
        margin-left: auto !important; /* Safety push to the right */
        order: 2; /* Ensures it stays after the logo */
    }

    .logo {
        order: 1;
    }
}