/* CSS Variables */
:root {
    --primary-color: #0A1433;
    --secondary-color: #1F2A44;
    --accent-color: #FFD700;
    --text-color: #FFFFFF;
    --font-family: 'Poppins', sans-serif;
    --heading-font: 'Montserrat', sans-serif;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
a:focus, button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Section animations */
.section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.preloader-progress {
    width: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--accent-color), #FF6F61);
    animation: progress 2s ease forwards;
}

@keyframes progress {
    to { width: 100%; }
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(180deg, var(--primary-color), transparent);
    padding: 1rem;
    z-index: 1000;
    transition: background 0.5s ease;
}

header.scrolled {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

.navbar {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.logo {
    font-family: var(--heading-font);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--secondary-color);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    min-width: 150px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    touch-action: manipulation;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cta-button {
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    touch-action: manipulation;
}

.cta-button:hover {
    background: #E6C200;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.cta-button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* Hero Section with overlay */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-top: 80px;
    background: url('hero-bg.jpg') no-repeat center/cover;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0.5; /* Adjust opacity as needed */
    z-index: -1;
}

#particles, .hero-video, .glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-video { object-fit: cover; z-index: -2; }
#particles { z-index: -3; }
.glitch-overlay {
    background: url('glitch.png') repeat;
    opacity: 0.1;
    animation: glitch 0.5s infinite;
    z-index: -1;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, 0); }
    80% { transform: translate(2px, 0); }
    100% { transform: translate(0); }
}

.hero-content {
    z-index: 1;
    background: rgba(10, 20, 51, 0.6);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    max-width: 90%;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-family: var(--heading-font);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    margin-bottom: 2rem;
    color: #E0E0E0;
}

.highlight {
    color: var(--accent-color);
    font-weight: 700;
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.trust-badges img {
    width: 100px;
    max-width: 150px;
    transition: transform 0.3s ease;
    loading: lazy; /* Added lazy loading */
}

.trust-badges img:hover { transform: scale(1.2); }

/* Section Padding */
.stats-dashboard, .services, .case-studies, .about, .team, .testimonials, .enhanced-contact, .portal-teaser {
    padding: 3rem 1rem;
}

/* Stats Dashboard */
.stats-dashboard {
    background: var(--secondary-color);
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.stat {
    background: rgba(255, 215, 0, 0.1);
    padding: 2rem;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.stat:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-10px);
}

.stat h3 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--accent-color);
}

.stat p { font-size: 1.2rem; }

/* Services Section */
.services { background: var(--primary-color); }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.service {
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: 15px;
    transition: all 0.3s ease;
    text-align: center;
}

.service:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Case Studies */
.case-studies { background: var(--secondary-color); }

.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.case-study {
    background: var(--primary-color);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
}

.case-study img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 1rem;
    loading: lazy; /* Added lazy loading */
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.video-modal[hidden] { display: none; }

.video-modal-content {
    position: relative;
    background: #000;
    padding: 1rem;
    border-radius: 10px;
    max-width: 90%;
}

.close-video {
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 2rem;
    color: #FFFFFF;
    cursor: pointer;
}

/* About Section */
.about {
    background: linear-gradient(to right, #1A1A1A, #333333);
    text-align: center;
}

.about-content { max-width: 1200px; margin: 0 auto; }

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-family: var(--heading-font);
    margin-bottom: 2rem;
}

.about p { font-size: 1.3rem; color: #E0E0E0; }

/* Team Section */
.team { background: var(--primary-color); }

.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.team-member {
    text-align: center;
    min-width: 200px;
    max-width: 300px;
}

.team-member img {
    width: 100%;
    max-width: 150px;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    loading: lazy; /* Added lazy loading */
}

/* Testimonials Section */
.testimonials { background: var(--secondary-color); }

.testimonial-carousel {
    max-width: 800px;
    margin: 0 auto;
}

.testimonial {
    display: none;
    background: #0B1533;
    padding: 2rem;
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.testimonial.active {
    display: flex;
    opacity: 1;
    align-items: center;
}

.testimonial-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    loading: lazy; /* Added lazy loading */
}

.testimonial p { flex-grow: 1; }
.testimonial cite { display: block; margin-top: 0.5rem; color: #E0E0E0; font-style: italic; }

/* Enhanced Contact Section */
.enhanced-contact {
    background: linear-gradient(135deg, var(--secondary-color), #2A3B5A);
    text-align: center;
}

.contact-container { max-width: 1200px; margin: 0 auto; }

.form-container {
    display: grid;
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.form-group {
    position: relative;
    text-align: left;
}

.form-group i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
    font-size: 1.2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 1rem 1rem 1rem 40px;
    background: var(--secondary-color);
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    color: var(--text-color);
    font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.form-group textarea { height: 150px; resize: vertical; }

#form-success {
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem auto;
    max-width: 600px;
}

#form-success[hidden] { display: none; }

.email-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.email-card {
    background: #2A3B5A;
    padding: 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.email-card:hover {
    background: #3A4B6A;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.email-card a {
    color: #FFD700;
    text-decoration: none;
}

.email-card a:hover {
    color: var(--text-color);
    text-decoration: underline;
}

/* Footer */
footer {
    padding: 3rem 1rem;
    background: var(--secondary-color);
    text-align: center;
}

.footer-content h3 { font-size: 2rem; margin-bottom: 0.5rem; }
.footer-bottom { font-size: 0.9rem; margin-top: 1rem; }
.privacy-button { color: var(--accent-color); text-decoration: none; }
.privacy-button:hover { color: var(--text-color); }

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal[hidden] { display: none; }

.modal-content {
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: 15px;
    max-width: 500px;
    text-align: center;
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    cursor: pointer;
}

.success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 10px;
    z-index: 1001;
    max-width: 300px;
}

.success-popup[hidden] { display: none; }

/* Cookie Consent */
#cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--secondary-color);
    color: var(--text-color);
    padding: 1rem;
    text-align: center;
    z-index: 1000;
}

#cookie-consent button {
    background: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    margin-left: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger { display: block; }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--primary-color);
        padding: 1rem;
        text-align: center;
    }
    .nav-links.show { display: flex; }
    .nav-links li a { padding: 15px; display: block; } /* Larger touch targets */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: var(--primary-color);
    }
    .services-grid, .case-studies-grid, .stats-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.2rem; }
    .trust-badges img { width: 100px; }
    .form-container { grid-template-columns: 1fr; }
    .services, .case-studies, .enhanced-contact, .portal-teaser { padding-bottom: 100px; }
    .cta-button { padding: 1rem 2rem; }
    #particles, .hero-video, .glitch-overlay { display: none; }
    .nav-buttons { display: none; }
    .nav-links li { margin-bottom: 1rem; }
}

@media (min-width: 769px) {
    .mobile-only { display: none; }
}