/* CSS Variables for consistent theming */
:root {
    --primary-color: #2a9d8f;
    --secondary-color: #264653;
    --accent-color: #e76f51;
    --light-bg: #f1faee;
    --white: #ffffff;
    --gray-light: #e9ecef;
    --gray-medium: #6c757d;
    --text-dark: #264653;
    --text-light: #6c757d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --max-width: 1200px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #64ffda;
    --secondary-color: #64ffda;
    --accent-color: #ff6b6b;
    --light-bg: #1e1e1e;
    --white: #121212;
    --gray-light: #2d2d2d;
    --gray-medium: #6b7280;
    --text-dark: #ffffff;
    --text-light: #b0b0b0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.6);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding {
    padding: 5rem 0;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

[data-theme="dark"] .navbar {
    background: rgba(18, 18, 18, 0.95);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

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

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    color: var(--text-dark);
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--gray-light);
    transform: scale(1.1);
}

.theme-toggle .sun-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition: all 0.3s ease;
}

.theme-toggle .moon-icon {
    position: absolute;
    opacity: 0;
    transform: scale(0.5) rotate(180deg);
    transition: all 0.3s ease;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: scale(0.5) rotate(180deg);
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(38, 70, 83, 0.7), rgba(42, 157, 143, 0.7)), 
                url('https://unsplash.com/photos/SYTO3xs06fU/download?ixid=M3wxMjA3fDB8MXxhbGx8fHx8fHx8fHwxNzUyMTc1MzkzfA&force=true') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    color: var(--white);
    filter: blur(0.5px);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(38, 70, 83, 0.8), rgba(42, 157, 143, 0.6));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 2rem;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-tagline {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.125rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.cta-button:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about {
    background: var(--light-bg);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    justify-items: center;
}

.service-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
    width: 100%;
    max-width: 350px;
    border: 1px solid var(--gray-light);
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.service-icon {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.service-card:hover .service-icon {
    color: var(--accent-color);
    transform: scale(1.1);
}

.service-title {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.service-description {
    color: var(--text-light);
    line-height: 1.6;
}

/* Contact Section */
.contact {
    background: var(--secondary-color);
    color: var(--white);
}

[data-theme="dark"] .contact {
    background: #0f0f0f;
}

.contact .section-title,
.contact .section-subtitle {
    color: var(--white);
}

[data-theme="dark"] .contact .section-title,
[data-theme="dark"] .contact .section-subtitle {
    color: #ffffff;
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    font-size: clamp(1rem, 2vw, 1.125rem);
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .contact-text {
    color: #e0e0e0;
}

.contact-button {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.125rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .contact-button {
    background: #64ffda;
    color: #000000;
}

.contact-button:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

[data-theme="dark"] .contact-button:hover {
    background: #ff6b6b;
    color: #ffffff;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}

[data-theme="dark"] .footer {
    background: #0a0a0a;
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

[data-theme="dark"] .footer p {
    color: #b0b0b0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Scroll reveal classes for JavaScript */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-controls {
        gap: 0.5rem;
    }
    
    .nav-menu {
        position: fixed;
        top: -100%;
        left: 0;
        width: 100%;
        height: auto;
        flex-direction: column;
        background-color: var(--white);
        text-align: center;
        transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: var(--shadow);
        padding: 2rem 0;
        border-radius: 0 0 1rem 1rem;
        z-index: 999;
        opacity: 0;
        visibility: hidden;
    }

    .nav-menu.active {
        top: 70px;
        opacity: 1;
        visibility: visible;
    }

    .nav-menu li {
        margin: 1rem 0;
        opacity: 0;
        transform: translateY(-20px);
    }

    .nav-menu.active li {
        animation: slideInFromTop 0.3s ease-out forwards;
    }

    .nav-menu.active li:nth-child(1) { animation-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { animation-delay: 0.2s; }
    .nav-menu.active li:nth-child(3) { animation-delay: 0.3s; }
    .nav-menu.active li:nth-child(4) { animation-delay: 0.4s; }

    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-card {
        padding: 2rem 1.5rem;
    }

    .section-padding {
        padding: 3rem 0;
    }

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 0 1rem;
    }

    .cta-button,
    .contact-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }

    .service-card {
        padding: 1.5rem 1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Larger screens optimization */
@media (min-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1000px;
        margin: 3rem auto 0;
    }
    
    .service-card:nth-child(4) {
        grid-column: 1 / 2;
    }
    
    .service-card:nth-child(5) {
        grid-column: 2 / 3;
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
        margin: 3rem auto 0;
    }
    
    .service-card:nth-child(5) {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus styles for accessibility */
.nav-link:focus,
.cta-button:focus,
.contact-button:focus,
.theme-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar {
        display: none;
    }
    
    .hero {
        height: auto;
        background: none;
        color: var(--text-dark);
        padding: 2rem 0;
    }
    
    .hero-overlay {
        display: none;
    }
}
