/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%; /* Prevent iOS text size adjust */
}

:root {
    --primary-color: #c8c8c8; /* Schwächeres Weiß mit grauem Unterton */
    --secondary-color: #f50057;
    --dark-color: #2c2c2c;
    --light-color: #f0f0f0;
    --grey-color: #a0a0a0;
    --section-padding: 100px 0; /* Increased vertical padding for sections */
    --side-padding: 5%; /* Side padding for content */
    
    /* Light theme (default) */
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-color: #2c2c2c;
    --text-secondary: #a0a0a0;
    --card-bg: #ffffff;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --header-bg: rgba(255, 255, 255, 0.9);
    --footer-bg: #2c2c2c;
    --footer-text: #ffffff;
}

/* Dark theme */
body[data-theme="dark"] {
    --bg-color: #121212;
    --bg-secondary: #1e1e1e;
    --text-color: #f8f9fa;
    --text-secondary: #cccccc;
    --card-bg: #1e1e1e;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    --header-bg: rgba(18, 18, 18, 0.9);
    --footer-bg: #000000;
    --footer-text: #f8f9fa;
    --primary-color: #b0b0b0; /* Graueres Weiß für den dunklen Modus */
}

/* Mixed theme (combination of light and dark) */
body[data-theme="mixed"] {
    --bg-color: #1e2030;
    --bg-secondary: #252a41;
    --text-color: #ffffff;
    --text-secondary: #cccccc;
    --card-bg: #ffffff;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --header-bg: rgba(30, 32, 48, 0.9);
    --footer-bg: #121212;
    --footer-text: #ffffff;
}

/* Theme section styles */
body[data-theme="dark"] .hero {
    background: linear-gradient(135deg, rgba(18, 18, 18, 0.95) 0%, rgba(30, 30, 30, 0.95) 100%);
}

body[data-theme="dark"] .burger div {
    background-color: var(--text-color);
}

body[data-theme="mixed"] .hero {
    background: linear-gradient(135deg, rgba(30, 32, 48, 0.95) 0%, rgba(37, 42, 65, 0.95) 100%);
}

body[data-theme="mixed"] .burger div {
    background-color: var(--text-color);
}

/* Main styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Section styling */
section {
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
    padding: var(--section-padding);
    margin-bottom: 30px; /* Add spacing between sections */
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px; /* Increased bottom margin */
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: #b0b0b0;
    bottom: -15px; /* Adjusted for better spacing */
    left: 50%;
    transform: translateX(-50%);
}

/* Container for content sections */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--side-padding);
    width: 100%;
}

/* About section */
.about {
    padding: var(--section-padding);
}

.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.about-text p {
    margin-bottom: 20px;
}

/* Social icons in About section */
.about-text .social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px auto;
}

.about-text .social-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--dark-color);
    color: var(--light-color);
    font-size: 1.4rem;
    transition: 0.3s;
}

.about-text .social-icon:hover {
    background-color: var(--primary-color);
    color: var(--dark-color);
    transform: translateY(-5px);
}

/* Skills section */
.skills {
    padding: var(--section-padding);
    background-color: var(--bg-secondary);
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--side-padding);
}

/* Education section */
.education {
    padding: var(--section-padding);
    background-color: var(--bg-secondary);
}

/* Resume section */
.resume {
    padding: var(--section-padding);
}

.resume-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px var(--side-padding);
}

/* Contact section */
.contact {
    padding: var(--section-padding);
    background-color: var(--bg-secondary);
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--side-padding);
}

/* Header styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--header-bg);
    backdrop-filter: blur(5px);
    z-index: 1000;
    box-sizing: border-box;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo span {
    color: var(--primary-color);
}

/* Navigation */
nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
}

.nav-links li {
    margin: 0 20px;
}

.nav-links a {
    position: relative;
    font-weight: 500;
    transition: 0.3s;
}

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

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

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

/* Burger menu for mobile */
.burger {
    display: none;
    cursor: pointer;
    margin-left: 15px;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Theme navbar */
.theme-navbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 15px;
    padding: 6px 10px;
    border-radius: 20px;
    background-color: var(--card-bg);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.theme-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 1rem;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    color: var(--text-color);
    background: none;
    border: none;
    cursor: pointer;
}

.theme-btn:hover {
    background-color: rgba(200, 200, 200, 0.3);
}

.theme-btn.active {
    background-color: var(--primary-color);
    color: #121212;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Hero section */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 100vh;
    padding: 0 var(--side-padding);
    padding-top: 100px;
    margin-bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 249, 249, 0.9) 100%);
}

.hero-content {
    flex: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.highlight {
    color: #c0c0c0;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--grey-color);
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 500;
    transition: 0.3s;
    cursor: pointer;
}

.primary-btn {
    background-color: #b0b0b0;
    color: #121212;
}

.primary-btn:hover {
    background-color: #a0a0a0;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(160, 160, 160, 0.3);
}

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

.secondary-btn:hover {
    background-color: #b0b0b0;
    color: #121212;
    transform: translateY(-3px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 550px;
    margin: 0 auto;
}

.profile-image {
    max-width: 500px;
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: float 6s ease-in-out infinite;
    display: block;
    margin: 0 auto;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Stats boxes */
.about-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 0 auto;
    margin-top: 20px;
}

.stat-box {
    background: linear-gradient(145deg, #ffffff, #f0f4ff);
    color: #2c2c2c;
    padding: 30px 20px;
    height: auto;
    min-height: 160px;
    width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 25px rgba(108, 99, 255, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(108, 99, 255, 0.25);
    background: linear-gradient(145deg, #ffffff, #e6eaff);
}

.stat-box h3 {
    color: var(--primary-color);
    font-size: 3.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.stat-box p {
    color: #2c2c2c;
    font-weight: 600;
    margin: 0;
    text-align: center;
    font-size: 1rem;
}

body[data-theme="dark"] .stat-box,
body[data-theme="mixed"] .stat-box {
    background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .stat-box:hover,
body[data-theme="mixed"] .stat-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .stat-box h3,
body[data-theme="mixed"] .stat-box h3 {
    color: #c0c0c0;
}

body[data-theme="dark"] .stat-box p,
body[data-theme="mixed"] .stat-box p {
    color: #cccccc;
}

/* Mobile adjustments */
@media screen and (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
        gap: 50px;
    }
    
    .profile-image {
        max-width: 400px;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --section-padding: 70px 0; /* Less padding on mobile */
        --side-padding: 4%; /* Slightly less side padding on mobile */
    }
    
    body {
        overflow-x: hidden;
    }
    
    .nav-links {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background-color: var(--bg-color);
        transform: translateX(100%);
        transition: transform 0.3s ease-in;
        z-index: 999;
        padding: 80px 0 30px;
    }
    
    .nav-links li {
        margin: 15px 0;
        opacity: 0;
    }
    
    .nav-links a {
        font-size: 1.2rem;
    }
    
    .burger {
        display: block;
        position: relative;
        z-index: 1000;
    }
    
    .nav-active {
        transform: translateX(0%);
    }
    
    .profile-image {
        max-width: 350px;
    }
    
    .section-title {
        margin-bottom: 40px;
        font-size: 2.2rem;
    }
    
    section {
        margin-bottom: 20px;
    }
    
    /* Hero section mobile adjustments */
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
        gap: 50px;
        min-height: auto;
        padding-bottom: 60px;
    }
    
    /* About section mobile adjustments */
    .about-stats {
        justify-content: center;
    }
    
    /* Timeline mobile adjustments */
    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding: 0 0 30px 60px;
    }
    
    .timeline::after {
        left: 30px;
    }
    
    .timeline-dot {
        left: 20px !important;
        right: auto !important;
    }
    
    /* Resume container mobile adjustments */
    .resume-container {
        flex-direction: column;
    }
    
    /* Contact container mobile adjustments */
    .contact-container {
        flex-direction: column;
    }
    
    /* Footer mobile adjustments */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links h3::after, 
    .footer-social h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .social-icons {
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    :root {
        --section-padding: 50px 0; /* Even less padding on small mobile */
        --side-padding: 3%; /* Even less side padding on small mobile */
    }
    
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero {
        padding-top: 100px;
        min-height: auto;
        padding-bottom: 60px;
    }
    
    .section-title {
        margin-bottom: 35px;
        font-size: 1.8rem;
    }
    
    .profile-image {
        max-width: 280px;
    }
    
    .theme-navbar {
        gap: 4px;
        padding: 4px 8px;
    }
    
    .theme-btn {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 0.9rem;
    }
    
    header {
        padding: 15px 10px;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .burger {
        margin-left: 8px;
    }
}

@media screen and (max-width: 360px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .profile-image {
        max-width: 240px;
    }
    
    .logo h1 {
        font-size: 1.1rem;
    }
    
    .theme-navbar {
        padding: 3px 6px;
    }
    
    .theme-btn {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Mobile burger animation */
.burger.active .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
    background-color: var(--text-color);
}

.burger.active .line2 {
    opacity: 0;
}

.burger.active .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
    background-color: var(--text-color);
}

/* Contact section */
.contact-container {
    padding: 0 var(--side-padding);
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 30px;
    text-align: center;
}

.contact-form {
    flex: 1;
    min-width: 300px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--grey-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
}

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

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 20px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    flex: 1;
    min-width: 200px;
}

.footer-logo h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.footer-logo span {
    color: var(--primary-color);
}

.footer-links {
    flex: 1;
    min-width: 200px;
}

.footer-links h3,
.footer-social h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
}

.footer-links h3::after,
.footer-social h3::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: -10px;
    left: 0;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    transition: 0.3s;
}

.footer-links ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-social {
    flex: 1;
    min-width: 200px;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--dark-color);
    color: var(--light-color);
    font-size: 1.2rem;
    transition: 0.3s;
}

.social-icon:hover {
    background-color: var(--primary-color);
    color: var(--dark-color);
    transform: translateY(-5px);
}

/* Skills Section */
.skill-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    width: 300px;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.skill-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: inline-block;
    /* Ensure icons render properly across all devices */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.skill-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.skill-card p {
    color: var(--text-secondary);
}

/* Universal Font Awesome icon fixes */
.fa-code::before {
    content: "\f121" !important;
}

.fa-desktop::before {
    content: "\f108" !important;
}

.fa-network-wired::before {
    content: "\f6ff" !important;
}

.fa-html5::before {
    content: "\f13b" !important;
}

.fa-windows::before {
    content: "\f17a" !important;
}

.fa-users::before {
    content: "\f0c0" !important;
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .contact-item {
        display: flex;
        align-items: center;
        margin-bottom: 25px;
    }
    
    .contact-item i {
        margin-right: 15px;
        min-width: 25px;
    }
    
    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-links, .footer-social {
        margin-top: 10px;
    }
    
    .social-icons {
        margin-top: 25px;
    }
    
    section {
        margin-bottom: 0; /* Remove additional margin on iOS */
    }
    
    .hero, .about, .skills, .education, .resume, .contact {
        padding-left: calc(var(--side-padding) + env(safe-area-inset-left));
        padding-right: calc(var(--side-padding) + env(safe-area-inset-right));
    }
    
    .timeline-item {
        width: 100%;
        left: 0 !important;
        margin-bottom: 30px;
    }
    
    .timeline::after {
        left: 30px;
    }
    
    .timeline-dot {
        left: 20px !important;
        right: auto !important;
    }
    
    .timeline-content {
        padding-left: 50px;
    }
    
    /* Fix for potential text encoding issues */
    html, body {
        -webkit-text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }
}

/* Mobile adjustments for smaller screens and iOS */
@media screen and (max-width: 480px) {
    .contact-item {
        margin-bottom: 25px;
    }
    
    .contact-item i {
        min-width: 30px;
        margin-right: 15px;
    }
    
    .footer-content > div {
        margin-bottom: 30px;
        width: 100%;
    }
    
    .footer-links ul li {
        margin-bottom: 15px;
    }
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .timeline-item {
        width: 100%;
        left: 0 !important;
    }
    
    .timeline::after {
        left: 30px;
    }
    
    .timeline-dot {
        left: 20px !important;
        right: auto !important;
    }
    
    .timeline-content {
        padding-left: 50px;
    }
    
    .skills-container {
        gap: 15px;
    }
    
    .skill-card {
        width: 100%;
        max-width: 350px;
    }
}

/* Education Section */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--side-padding);
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--primary-color);
    border-radius: 50%;
    top: 25px;
    z-index: 1;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-content {
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.timeline-content h3 {
    margin-bottom: 10px;
}

.timeline-date {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Resume Section */
.resume-info {
    flex: 1;
    min-width: 300px;
}

.resume-info p {
    margin-bottom: 20px;
}

.resume-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.resume-preview {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.resume-page {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.resume-embed {
    width: 100%;
    height: 100%;
    border: none;
}

.resume-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.resume-placeholder i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.resume-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 0.9rem;
}
