/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    /* Dark mode variables */
    --dark-primary-color: #60a5fa;
    --dark-secondary-color: #3b82f6;
    --dark-accent-color: #fbbf24;
    --dark-text-dark: #ffffff;
    --dark-text-light: #d1d5db;
    --dark-bg-light: #374151;
    --dark-bg-white: #111827;
    --dark-border-color: #4b5563;
}

.dark-mode {
    --primary-color: var(--dark-primary-color);
    --secondary-color: var(--dark-secondary-color);
    --accent-color: var(--dark-accent-color);
    --text-dark: var(--dark-text-dark);
    --text-light: var(--dark-text-light);
    --bg-light: var(--dark-bg-light);
    --bg-white: var(--dark-bg-white);
    --border-color: var(--dark-border-color);
}

.dark-mode .navbar {
    background-color: rgba(15, 23, 42, 0.96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.dark-mode .nav-link {
    color: #e5e7eb;
}

.dark-mode .nav-link:hover,
.dark-mode .nav-link.active {
    color: var(--primary-color);
}

.dark-mode .hamburger span {
    background-color: #e5e7eb;
}

.dark-mode .nav-menu {
    background-color: rgba(15, 23, 42, 0.97);
}

.dark-mode .nav-menu li a {
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.3);
    background-color: transparent;
}

.dark-mode .nav-menu li a:hover {
    color: var(--primary-color);
    background-color: transparent;
}

.dark-mode .theme-toggle {
    color: #e5e7eb;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 40%, #ffffff 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Back link used on auxiliary pages */
.back-link {
    display: inline-block;
    margin: 10px 0 20px 0;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.95rem;
}
.back-link:hover {
    color: var(--primary-color);
}

/* ===== Sticky Navigation ===== */
.navbar {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
}

    .nav-link.active {
    color: var(--secondary-color);
    font-weight: bold;

}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    
}

.logo a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.logo-icon a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    
}

.logo:hover {
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap; /* prevent wrapping like "Über me<br>hr" */
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ===== Hamburger Menu ===== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-dark);
    transition: color 0.3s ease;
    margin-left: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--primary-color);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    background-image: linear-gradient(180deg, rgba(37, 99, 235, 0.85), rgba(59, 130, 246, 0.15)), url('assets/bg-decorative.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 120px 20px;
    text-align: center;
    margin-top: 70px;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 140%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.28;
    pointer-events: none;
    mix-blend-mode: screen;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    animation: slideDown 0.8s ease;
}

.hero-content p {
    font-size: 1.5rem;
    opacity: 0.9;
    animation: slideUp 0.8s ease 0.2s backwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== About Section ===== */
.about {
    padding: 80px 20px;
    background-color: var(--bg-light);
}

.about h2 {
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-align: center;
    color: var(--text-dark);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-light);
    line-height: 1.8;
}

.about-text strong {
    color: var(--primary-color);
}

.about-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-item {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border-left: 4px solid var(--primary-color);
}

.info-item h3 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.info-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.dark-mode .info-item h3,
.dark-mode .info-item p {
    color: #000000;
}

/* ===== Hobbies Section ===== */
.hobbies {
    padding: 80px 20px;
    background-color: var(--bg-white);
}

.hobbies h2 {
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-align: center;
    color: var(--text-dark);
}

.hobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.hobby-card {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.hobby-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.hobby-link:hover,
.hobby-link:focus {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.hobby-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, white 0%, #f9fafb 100%);
}

.hobby-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: inline-block;
    animation: bounce 2s infinite;
}

.hobby-card:nth-child(1) .hobby-icon {
    animation-delay: 0s;
}

.hobby-card:nth-child(2) .hobby-icon {
    animation-delay: 0.2s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hobby-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.hobby-card h3::before {
    content: "★ ";
    color: var(--accent-color);
}

.hobby-card p {
    color: var(--text-light);
    line-height: 1.6;
}

.dark-mode .hobby-card h3,
.dark-mode .hobby-card p {
    color: #000000;
}

/* ===== Projects Section ===== */
.projects {
    padding: 80px 20px;
    background-color: var(--bg-light);
}

.projects h2 {
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-align: center;
    color: var(--text-dark);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-color);
    overflow: visible; /* allow hover descriptions (tooltips) to appear in front of the card */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.project-card h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.project-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.dark-mode .project-card h3,
.dark-mode .project-card p {
    color: #000000;
}

.project-images {
    display: flex;
    flex-direction: column; /* stack images vertically inside the card */
    gap: 12px;
    margin: 0 0 15px; /* keep images slightly inset from the card edge */
    padding: 0 12px; /* inner horizontal padding so images don't touch the card edges */
    align-items: stretch;
    overflow: hidden;
}

.project-images img {
    width: 100%;
    height: 260px; /* larger images on desktop */
    object-fit: cover;
    border-radius: 12px; /* rounded corners for images */
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

@media (max-width: 1024px) {
    .project-images img {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .project-images {
        margin: 0 0 15px;
        padding: 0; /* on small screens let images reach card padding area */
    }
    .project-images img {
        height: 200px; /* slightly smaller on small screens */
        border-radius: 8px;
    }
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

    /* ===== Gallery Section ===== */
    .gallery {
        padding: 80px 20px;
        /* clearer, less "milky" background */
        background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(239,246,255,0.35) 100%);
    }

    .gallery h2 {
        font-size: 2.5rem;
        margin-bottom: 40px;
        color: var(--text-dark);
        text-align: center;
    }

    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 24px;
    }

    .gallery-item {
        position: relative;
        overflow: hidden;
        border-radius: 24px;
        box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
        transform: translateZ(0);
    }

    .gallery-item img {
        width: 100%;
        height: auto;
        display: block;
        clip-path: polygon(0 0, 100% 0, 100% 80%, 0 100%);
        mask-image: radial-gradient(circle at top right, rgba(255,255,255,1), rgba(255,255,255,0));
        transition: transform 0.5s ease;
    }

    .gallery-item figcaption {
        background: rgba(255, 255, 255, 0.85); /* slightly more transparent caption */
        color: var(--text-dark);
        padding: 16px 18px;
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .gallery-item:hover img {
        transform: scale(1.05) rotate(-0.5deg);
    }


/* hover effect and descriptions for KMD & MBK tags */
.kmd-tags .tag,
.mbk-tags .tag {
    position: relative;
    overflow: visible; /* allow absolute description to overflow without affecting layout */
    /* no extra padding; card stays same size */
    transition: none;
    /* original small dimensions */
    padding: 2px 4px;
    font-size: 0.85rem; /* keep text size unchanged */
}

/* description now absolutely positioned so it doesn't affect card size */
.kmd-tags .tag::after,
.mbk-tags .tag::after {
    content: attr(data-desc);
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 8px;
    background: var(--primary-color);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: normal;
    font-size: 0.85rem;
    /* allow width to fit content, with a sensible max */
    width: max-content;
    max-width: 200px;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 9999; /* ensure it appears above the card and other content */
}
.kmd-tags .tag:hover::after,
.mbk-tags .tag:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.tag {
    background-color: var(--bg-light);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ===== Testimonials Section ===== */
.testimonials {
    padding: 80px 20px;
    background-color: var(--bg-white);
}

.testimonials h2 {
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-align: center;
    color: var(--text-dark);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.testimonial-card p {
    color: var(--text-dark);
    font-style: italic;
    margin-bottom: 15px;
    line-height: 1.6;
}

.testimonial-card cite {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.dark-mode .testimonial-card {
    background-color: #374151;
}

.dark-mode .testimonial-card p,
.dark-mode .testimonial-card cite {
    color: #ffffff;
}

.add-testimonial {
    margin-top: 50px;
    text-align: center;
}

.add-testimonial h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

#testimonialForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

#testimonialForm textarea,
#testimonialForm input {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

#testimonialForm textarea {
    resize: vertical;
    min-height: 100px;
}

#testimonialForm button {
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#testimonialForm button:hover {
    background-color: var(--secondary-color);
}

/* ===== Contact Section ===== */
.contact {
    padding: 80px 20px;
    background-color: white;
    text-align: center;
}

.contact h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.contact-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.contact-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.contact-button::before {
    content: "✉️ ";
}

.contact-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.dark-mode .contact {
    background-color: #1f2937;
}

.dark-mode .contact h2,
.dark-mode .contact-content p {
    color: #ffffff;
}

/* ===== Footer ===== */
.footer {
    background: url('assets/bg-decorative.jpg') center/cover no-repeat;
    background-color: var(--text-dark);
    background-blend-mode: overlay;
    color: white;
    padding: 40px 20px;
    font-size: 0.95rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
    text-align: left;
}

.footer-section h3 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.footer-section h3::before {
    content: "▹ ";
    color: var(--primary-color);
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    margin-bottom: 8px;
}

.footer-list a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-list a:hover {
    color: var(--accent-color);
}

.footer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.footer-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.footer-table td {
    padding: 10px 10px;
    vertical-align: middle;
}

.footer-table td:first-child {
    width: 40%;
    color: var(--accent-color);
}

.footer-table a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-table a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 20px;
    margin-top: 20px;
}

.footer-bottom p {
    margin: 0;
}

.dark-mode .footer {
    background-color: #1f2937;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--bg-white);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        max-height: 400px;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link::after {
        display: none;
    }

    .nav-menu li a:hover {
        background-color: var(--bg-light);
    }

    .nav-container {
        flex-direction: row;
        height: auto;
        padding: 15px 20px;
        position: relative;
    }

    .theme-toggle {
        position: absolute;
        top: 18px;
        right: 20px;
        margin-left: 0;
    }

    .logo-container {
        width: auto;
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }


    .hobbies-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .about h2,
    .hobbies h2,
    .projects h2,
    .contact h2 {
        font-size: 1.8rem;
    }

    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 20px;
        margin-top: 0;
    }

    .hero-video {
        display: none;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .about,
    .hobbies,
    .projects,
    .contact {
        padding: 50px 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}
