/* ===== CSS RESET & BASE STYLES ===== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter/Inter-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter/Inter-Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter/Inter-SemiBold.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter/Inter-Bold.ttf') format('truetype');
}

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

/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #EDFF51;
    --primary-dark: #d4e647;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    
    /* Dark Theme Colors */
    --bg-dark: #35373D;
    --bg-darker: #2a2b30;
    --bg-light: #404248;
    --bg-white: #35373D;
    
    /* Text Colors */
    --text-dark: #ffffff;
    --text-light: #cbd5e1;
    --text-white: #ffffff;
    
    /* Border & Shadow */
    --border-color: #4b5563;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* ===== BASE STYLES ===== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-dark);
    /* Word wrapping for long words */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

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

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    /* Word wrapping for long headings */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
    /* Word wrapping for long paragraphs */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* ===== LINKS ===== */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--bg-dark);
    transform: translateY(-2px);
}

/* ===== NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(53, 55, 61, 0.6);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.nav-logo-img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: var(--transition);
    /* Fallback if image doesn't load */
    min-width: 40px;
}

.nav-logo h2 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0; /* Remove default margin for better centering */
}

.desktop-logo {
    display: block;
}

.mobile-logo {
    display: none;
}

@media (max-width: 768px) {
    .desktop-logo {
        display: none;
    }
    
    .mobile-logo {
        display: block;
    }
}

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

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    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%;
}

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

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

/* ===== HERO SECTION ===== */
.hero {
    padding: 120px 0 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: url('Ingenieurbuero-Berlin.jpg') center center/cover no-repeat;
    background-attachment: scroll;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(53, 55, 61, 0.6);
    z-index: 1;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== FEATURES SECTION ===== */
.features {
    padding: 80px 0;
    background-color: var(--bg-darker);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.feature-card {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon i {
    font-size: 1.5rem;
    color: var(--bg-dark);
}

.feature-card h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

/* ===== SERVICES SECTION ===== */
.services {
    padding: 80px 0;
    position: relative;
    background: url('INGGV-Leistungen.jpg') center center/cover no-repeat;
}

.services-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(53, 55, 61, 0.9);
    z-index: 1;
}

.services .container {
    position: relative;
    z-index: 2;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--bg-light);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-color), #d97706);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.service-icon i {
    font-size: 1.5rem;
    color: var(--bg-dark);
}

.service-card h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

/* ===== PROJECTS SECTION ===== */
.projects {
    padding: 80px 0;
    background-color: var(--bg-darker);
}

.section-subtitle {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.project-card {
    background-color: var(--bg-light);
    padding: 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-align: center;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-darker);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto 1.5rem;
}

.project-icon i {
    font-size: 1.8rem;
    color: var(--bg-dark);
}

.project-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-card h3 {
    color: var(--text-dark);
    margin: 1.5rem 1.5rem 0.5rem;
}

.project-card p {
    margin: 0 1.5rem 1.5rem;
    flex-grow: 1;
}

.project-btn {
    margin: 0 1.5rem 1.5rem;
    align-self: center;
}

/* ===== CONTACT SECTION ===== */
.contact {
    padding: 80px 0;
    position: relative;
    background: url('Nikolaj-Gavrilov-Kontakt.jpg') center center/cover no-repeat;
}

.contact-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(53, 55, 61, 0.85);
    z-index: 1;
}

.contact .container {
    position: relative;
    z-index: 2;
}

.contact-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    width: 100%;
}

.contact-item {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    text-align: center;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.contact-icon i {
    font-size: 1.5rem;
    color: var(--bg-dark);
}

.contact-details h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.contact-details p {
    color: var(--text-light);
    margin-bottom: 0;
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--bg-darker);
    padding: 3rem 0 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    /* Word wrapping for long words in footer */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.footer-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-light);
    margin: 5% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

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

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.fade-in.visible {
    opacity: 1;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .service-card-full-width {
        grid-column: 1 / -1;
    }
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(53, 55, 61, 0.95);
        backdrop-filter: blur(20px);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        padding: 2rem 0;
        box-shadow: var(--shadow-md);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hero-container {
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* Remove specific mobile overrides for contact-info to let auto-fit work */
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Navigation logo mobile styles */
    .nav-logo {
        gap: 8px;
    }
    
    .nav-logo-img {
        height: 32px;
    }
    
    .nav-logo h2 {
        font-size: 1.1rem;
    }
    
    /* Content page mobile styles */
    .content-wrapper {
        padding: 2rem 1.5rem;
        margin: 0 15px;
        /* Enhanced word breaking for mobile */
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .content-wrapper h1 {
        font-size: 2rem;
        word-break: break-word;
        hyphens: auto;
    }
    
    .content-section h2 {
        font-size: 1.3rem;
        word-break: break-word;
        hyphens: auto;
    }
    
    .content-section h3 {
        font-size: 1.1rem;
        word-break: break-word;
        hyphens: auto;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .feature-card,
    .service-card {
        padding: 1.5rem;
    }
    
    .project-card {
        padding: 0;
    }
    
    .features-grid {
        gap: 1.5rem;
    }
    
    /* contact-info handled by auto-fit now */

    .contact-item {
        padding: 1.5rem; /* Slightly reduce padding on mobile */
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Navigation logo small mobile styles */
    .nav-logo {
        gap: 6px;
    }
    
    .nav-logo-img {
        height: 28px;
    }
    
    .nav-logo h2 {
        font-size: 0.95rem;
    }
    
    /* Content page small mobile styles */
    .content-wrapper {
        padding: 1.5rem 1rem;
        margin: 0 10px;
    }
    
    .content-wrapper h1 {
        font-size: 1.75rem;
        word-break: break-word;
        hyphens: auto;
        line-height: 1.2;
    }
    
    .content-section h2 {
        font-size: 1.2rem;
        word-break: break-word;
        hyphens: auto;
        line-height: 1.3;
    }
    
    .content-section h3 {
        font-size: 1rem;
        word-break: break-word;
        hyphens: auto;
        line-height: 1.3;
    }
    
    .content-section p {
        font-size: 0.95rem;
        word-break: break-word;
        hyphens: auto;
        line-height: 1.5;
    }
}

/* ===== CONTENT PAGE STYLES ===== */
.content-page {
    padding: 120px 0 80px;
    background-color: var(--bg-dark);
    min-height: 100vh;
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-light);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    /* Word wrapping for long German words */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    /* Fallback for extremely long words */
    word-break: break-word;
}

.content-wrapper h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    /* Word wrapping for long titles */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.content-section {
    margin-bottom: 2rem;
}

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    /* Word wrapping for long headings */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.content-section h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    /* Word wrapping for long subheadings */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.content-section p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
    /* Word wrapping for long paragraphs */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.content-section ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.content-section li {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.content-section a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.content-section a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.content-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.content-footer p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

/* ===== LOADING ANIMATION ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
