/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Color Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #06b6d4;
    --secondary-dark: #0891b2;
    --dark: #0f172a;
    --dark-gray: #1e293b;
    --medium-gray: #334155;
    --light-gray: #cbd5e1;
    --white: #ffffff;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-hover: rgba(30, 41, 59, 0.8);
}

/* Body Styling */
html {
    background-color: var(--dark);
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container Styling */
.hero-skills-container,
.contact-timeline-container,
.work-section {
    padding: 40px 0;
    max-width: 1400px;
    margin: 0 auto;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 50px;
    background-color: rgba(15, 23, 42, 0.95);
    z-index: 100;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style-type: none;
    display: flex;
    gap: 35px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-light);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 12px;
}

.lang-btn {
    width: 32px;
    height: 24px;
    border: none;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.lang-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.lang-btn.active {
    outline-color: var(--primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
    transform: scale(1.1);
}

#lang-hu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 600'%3E%3Crect width='900' height='600' fill='%23CE1126'/%3E%3Crect y='200' width='900' height='200' fill='%23FFFFFF'/%3E%3Crect y='400' width='900' height='200' fill='%23228B22'/%3E%3C/svg%3E");
}

#lang-en {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='s'%3E%3Cpath d='M0,0 v30 h60 v-30 z'/%3E%3C/clipPath%3E%3CclipPath id='t'%3E%3Cpath d='M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z'/%3E%3C/clipPath%3E%3Cg clip-path='url(%23s)'%3E%3Cpath d='M0,0 v30 h60 v-30 z' fill='%2300247D'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23FFFFFF' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' clip-path='url(%23t)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23FFFFFF' stroke-width='10'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/g%3E%3C/svg%3E");
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    transition: all 0.3s;
    border-radius: 2px;
}

/* Hero Section */
.hero-skills-container {
    display: flex;
    gap: 30px;
    margin-top: 100px;
    padding: 0 50px;
}

.hero {
    flex: 1.5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 50px;
    background: var(--card-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.hero:hover {
    background: var(--card-hover);
    border-color: var(--primary);
}

.location-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    width: fit-content;
}

.location-tag i {
    color: var(--primary);
}

.hero-content h2 {
    font-size: 3rem;
    font-weight: 700;
    margin: 15px 0;
    background: linear-gradient(135deg, var(--white), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.hero-content h3 {
    font-size: 1.75rem;
    margin: 15px 0 25px;
    font-weight: 500;
    min-height: 2.8rem;
    color: var(--text-secondary);
}

#role {
    color: var(--primary-light);
    font-weight: 600;
}

#role span {
    display: inline-block;
    animation: slideDown 0.5s ease-in-out;
    white-space: nowrap;
}

#role span.slide-out {
    animation: slideUp 0.5s ease-in-out;
}

@keyframes slideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

.description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin: 25px 0;
    max-width: 550px;
    line-height: 1.7;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin: 30px 0 0;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    color: var(--text-secondary);
    font-size: 1.25rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icons a i {
    text-decoration: none;
}

.social-icons a:hover {
    color: var(--white);
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Button Styling */
.btn {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

/* Hero Image */
.hero-image {
    width: 288px;
    height: 431px;
    min-width: 288px;
    border-radius: 16px;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hero-image:hover img {
    transform: scale(1.05);
}

/* Skills Section */
.skills-section {
    flex: 1;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.skills-section:hover {
    background: var(--card-hover);
    border-color: var(--primary);
}

.skills-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    background: linear-gradient(135deg, var(--white), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skill-item {
    display: flex;
    align-items: center;
    background: rgba(51, 65, 85, 0.5);
    color: var(--white);
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--border-color);
}

.skill-level {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 12px 0 0 12px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.3;
    z-index: 0;
}

.skill-item:hover {
    transform: translateX(5px);
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.skill-item:hover .skill-level {
    opacity: 0.5;
}

/* Contact and Experience Sections */
.contact-timeline-container {
    display: flex;
    gap: 30px;
    padding: 40px 50px;
}

.contact,
.experience {
    padding: 40px;
    background: var(--card-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.contact:hover,
.experience:hover {
    background: var(--card-hover);
    border-color: var(--primary);
}

.contact {
    flex: 1;
}

.experience {
    flex: 1;
}

.contact-block h2,
.timeline-block h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--white), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-icons {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-icon {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.contact-icon:hover {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    transform: translateX(5px);
}

.contact-icon i {
    font-size: 1.2rem;
    width: 24px;
    color: var(--primary);
}

/* Timeline */
.timeline-block {
    position: relative;
    padding-left: 35px;
}

.timeline-block::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 25px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 8px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.timeline-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--white);
}

.timeline-date {
    color: var(--primary-light);
    font-weight: 500;
    margin-bottom: 8px;
}

.timeline-item p {
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.6;
}

/* GitHub Projects Section */
.work-section {
    max-width: 1400px;
}

.work-section > h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    padding: 20px 50px;
    background: linear-gradient(135deg, var(--white), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.work-section > .work-gallery {
    border-radius: 20px;
    margin: 0 50px;
}

.work-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.github-project {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 18px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.github-project:hover {
    transform: translateY(-8px);
    background: var(--card-hover);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.project-title {
    font-size: 1.35rem;
    color: var(--primary-light);
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

.github-stats {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.github-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
}

.github-stats i {
    color: var(--primary);
}

.project-description {
    color: var(--text-secondary);
    flex-grow: 1;
    margin: 0;
    line-height: 1.6;
}

.project-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
    flex-wrap: wrap;
}

.github-btn,
.website-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    flex: 1 1 140px;
}

.github-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.github-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.website-btn {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.website-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
}

/* Background Particles */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero-skills-container {
        flex-direction: column;
    }

    .contact-timeline-container {
        flex-direction: column;
    }

    .work-gallery {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 25px;
        justify-content: flex-start;
    }

    .logo {
        font-size: 1.3rem;
    }

    .hamburger {
        display: flex;
        margin-left: 15px;
        margin-right: 0;
    }

    .lang-switcher {
        margin-left: auto;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        padding: 30px 0;
        gap: 20px;
        display: none;
        border-bottom: 1px solid var(--border-color);
        transform: none;
        position: fixed;
    }

    .nav-links.active {
        display: flex;
    }

    .hero-skills-container,
    .contact-timeline-container,
    .work-section > .work-gallery {
        padding: 0 25px;
        margin: 0 25px;
    }

    .hero-skills-container {
        margin-top: 120px; /* Increased from 90px to fix offscreen location tag */
        margin-bottom: 50px; /* Added spacing between skills and contact */
        gap: 25px;
    }

    .work-section > h2 {
        padding: 20px 25px;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 35px 25px;
    }

    .hero-content h2 {
        font-size: 2.2rem;
    }

    .hero-content h3 {
        font-size: 1.4rem;
    }

    .description {
        margin: 20px auto;
        max-width: 100%;
    }

    .location-tag {
        margin: 0 auto 15px;
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .hero-image {
        margin-top: 30px;
        width: 240px;
        height: 360px;
        min-width: 240px;
    }

    .social-icons {
        justify-content: center;
        gap: 12px;
    }

    .social-icons a {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .skills-section,
    .contact,
    .experience {
        padding: 30px 25px;
    }

    .contact-timeline-container {
        gap: 25px;
    }

    .work-gallery {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .project-header {
        flex-direction: column;
        gap: 12px;
    }

    .github-stats {
        align-self: flex-start;
    }

    .project-buttons {
        gap: 10px;
    }

    .github-btn,
    .website-btn {
        padding: 8px 14px; /* Reduced padding */
        font-size: 0.85rem;
        flex: 1 1 120px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}