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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f8fafc;
    font-size: 16px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Circuit Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.15;
    background: url('circuit-bg.svg') center center/cover no-repeat;
}

/* Modern Header Design */
header {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #1e3a8a 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    min-height: 80px;
}

/* Logo and Title */
.logo-title {
    justify-self: start;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 48px;
    height: auto;
    flex-shrink: 0;
}

.title-text {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.125rem;
    display: block;
}

.site-claim {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    display: block;
}

/* Navigation */
.main-nav {
    justify-self: center;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.25rem;
    backdrop-filter: blur(10px);
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-menu a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.nav-menu a.active {
    background: white;
    color: #1e3a8a;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Language Switch */
.language-switch {
    justify-self: end;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.lang-btn .flag {
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 100px auto 60px auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
    flex: 1;
}

/* Tab Content */
.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-content.active {
    display: block;
    opacity: 1;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Typography */
h1, h2, h3, h4 {
    color: #1e3a8a;
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 2.25rem;
    margin-bottom: 2rem;
    line-height: 1.2;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: #3b82f6;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0 3rem 0;
}

.hero h1 {
    background: linear-gradient(135deg, #06b6d4, #3b82f6, #1e3a8a);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* CTA Button */
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* Services Section */
.services-overview {
    margin-bottom: 3rem;
}

.services-block h3 {
    color: #1e3a8a;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.services-block {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.services-main-list {
    list-style: none;
    display: grid;
    gap: 1rem;
}

.services-main-list li {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Skills Section */
.skills-section {
    margin-top: 3rem;
}

.skills-section > h3 {
    color: #1e3a8a;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.skills-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skills-groups > div {
    background: linear-gradient(135deg, #fafafa, #f1f5f9);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: transform 0.3s ease;
}

.skills-groups > div:hover {
    transform: translateY(-5px);
}

.skills-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skills-list li {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.skills-list li:hover {
    transform: scale(1.05);
}

/* Profile Section */
.profile-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 2rem;
    border: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.profile-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1e3a8a;
}

.profile-info p {
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.profile-info a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.profile-info a:hover {
    color: #1e3a8a;
}

/* Projects Section */
.projects-list {
    list-style: none;
    display: grid;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.projects-list li {
    background: linear-gradient(135deg, #fafafa, #f1f5f9);
    padding: 2rem;
    border-radius: 16px;
    border-left: 4px solid #06b6d4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    line-height: 1.7;
    transition: transform 0.3s ease;
}

.projects-list li:hover {
    transform: translateY(-3px);
}

.projects-list strong {
    color: #1e3a8a;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Project Gallery */
.gallery-title {
    margin-top: 3rem;
    margin-bottom: 2rem;
    color: #1e3a8a;
    font-size: 1.75rem;
}

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

.gallery-item {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    /* Prevent layout shift during loading */
    min-height: 350px;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    /* Smooth loading transition - will be overridden by JS */
    transition: opacity 0.3s ease;
    /* Prevent image flicker during load */
    background-color: #f3f4f6;
}

.gallery-caption {
    padding: 1.5rem;
    font-weight: 600;
    color: #1e3a8a;
    text-align: center;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #3b82f6, #1e3a8a);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    margin-top: auto;
}

footer a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #e0f2fe;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 1.5rem;
        gap: 1.5rem;
    }
    
    main {
        padding: 0 1.5rem;
    }
    
    .tab-content {
        padding: 2rem;
    }
    
    .skills-groups {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
        min-height: auto;
    }
    
    .logo-title {
        justify-self: center;
    }
    
    .main-nav {
        justify-self: center;
        order: 3;
    }
    
    .language-switch {
        justify-self: center;
        order: 2;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .nav-menu a {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    main {
        margin-top: 200px;
        padding: 0 1rem;
    }
    
    .tab-content {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2.25rem;
    }
    
    h2 {
        font-size: 1.875rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .profile-card {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .skills-groups {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-gallery {
        grid-template-columns: 1fr;
    }
    
    .services-main-list li {
        padding: 1.25rem;
        font-size: 1rem;
    }
    
    .skills-groups > div {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.4rem;
    }
    
    .site-claim {
        font-size: 0.75rem;
    }
    
    .nav-menu a {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .lang-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    main {
        margin-top: 220px;
    }
    
    .tab-content {
        padding: 1rem;
        border-radius: 12px;
    }
    
    h1 {
        font-size: 1.875rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero {
        padding: 1rem 0 2rem 0;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .cta-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .services-block,
    .skills-groups > div,
    .projects-list li {
        padding: 1.25rem;
    }
    
    .services-main-list li {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    .profile-card {
        padding: 1.5rem;
    }
    
    .profile-pic {
        width: 100px;
        height: 100px;
    }
}

/* Impressum Styles */
#impressum-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

#impressum-content h3 {
    color: #1e3a8a;
    margin: 2rem 0 1rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

#impressum-content h4 {
    color: #374151;
    margin: 1.5rem 0 0.8rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

#impressum-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

#impressum-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

#impressum-content li {
    margin-bottom: 0.3rem;
}

#impressum-content strong {
    color: #1f2937;
}

#impressum-content a {
    color: #3b82f6;
    text-decoration: none;
}

#impressum-content a:hover {
    text-decoration: underline;
}

/* Responsive adjustments for legal content */
@media (max-width: 768px) {
    #impressum-content {
        padding: 0 1rem;
    }
    
    #impressum-content h3 {
        font-size: 1.2rem;
    }
    
    #impressum-content h4 {
        font-size: 1rem;
    }
}
