/* ==========================================
   Alapbeállítások és resetelés
   ========================================== */

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

:root {
    /* Színek - sötétebb, elegánsabb kék árnyalatok a háttérképhez igazítva */
    --primary-color: #1e3a5f;
    /* Sötét kék (mint a könyvek) */
    --primary-dark: #152943;
    /* Még sötétebb kék */
    --primary-light: #2d5a8c;
    /* Világosabb, de nem rikító */
    --accent-color: #4a7ba7;
    /* Hangsúly szín (mint az ég) */
    --secondary-color: #64748b;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;

    /* Tipográfia */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Egyéb */
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-primary);
    line-height: var(--line-height-base);
    color: var(--text-dark);
    overflow-x: hidden;
    /* Nagyon finom háttér - gradient + noise textúra */
    background-color: #ffffff;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E"),
        linear-gradient(to bottom, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
}

/* ==========================================
   Navigáció
   ========================================== */

#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

#navbar.scrolled {
    box-shadow: var(--shadow-md);
}

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

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    height: 40px;
    width: auto;
    transition: var(--transition);
}

.nav-logo:hover {
    transform: scale(1.05);
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

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

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

.nav-link.active::after {
    width: 100% !important;
}

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

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 700;
    background-color: rgba(30, 58, 95, 0.1);
}

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

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: var(--transition);
}

/* ==========================================
   Általános elemek
   ========================================== */

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

.section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--text-dark);
}

.bg-light {
    background: linear-gradient(to right, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
}

.text-center {
    text-align: center;
    margin-top: var(--spacing-md);
}

/* Gombok */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-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: white;
}

/* ==========================================
   Hero szekció
   ========================================== */

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Loading háttérszín amíg a kép betöltődik */
    background-color: #2d5a8c;
    /* WebP háttér modern böngészőknek, JPEG fallback régebbieknek */
    background-image: url('hero-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: white;
    text-align: center;
    padding-top: 80px;
    position: relative;
}

/* Fallback JPEG-re, ha a böngésző nem támogatja a WebP-t */
.no-webp .hero-section {
    background-image: url('hero-bg-opt.jpg');
}

/* Sötét overlay a jobb olvashatóságért */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    animation: fadeInUp 0.8s ease-out;
    line-height: 1.2;
}

.hero-title-prefix,
.hero-title-suffix {
    font-size: 1.8rem;
    font-weight: 400;
    opacity: 0.9;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 800;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-description {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.85;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-section .btn-primary {
    animation: fadeInUp 0.8s ease-out 0.6s both;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 58, 95, 0.4);
}

.hero-section .btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.6);
}

/* ==========================================
   Rólam szekció - Timeline
   ========================================== */

.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.about-intro {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    align-items: start;
}

.profile-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.intro-text p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-light));
}

.timeline-item {
    position: relative;
    margin-bottom: var(--spacing-lg);
    opacity: 0;
    transform: translateX(-30px);
}

.timeline-item.visible {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.timeline-dot {
    position: absolute;
    left: -3.5rem;
    top: 0;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color);
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.timeline-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.timeline-date {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.timeline-content p {
    color: var(--text-dark);
}

/* ==========================================
   Kutatási témák szekció
   ========================================== */

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

.research-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

.research-card.visible {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

.research-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.research-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.research-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* ==========================================
   Publikációk szekció
   ========================================== */

.publications-intro {
    max-width: 900px;
    margin: 0 auto 3rem;
    text-align: center;
}

.publications-intro p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.pub-databases {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.pub-databases .btn-secondary {
    margin: 0;
    display: inline-block;
    padding: 1rem 2rem;
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.pub-databases .btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.publications-list {
    max-width: 900px;
    margin: 0 auto;
}

.publication-item {
    background: white;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateX(-30px);
}

.publication-item.visible {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.publication-item h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
}

.pub-authors {
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 0.25rem;
}

.pub-journal {
    color: var(--text-light);
    margin-bottom: var(--spacing-xs);
}

.pub-description {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: var(--spacing-xs);
}

.pub-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

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

/* ==========================================
   Könyvek szekció
   ========================================== */

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.book-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    opacity: 0;
    transform: scale(0.9);
}

.book-card.visible {
    animation: fadeInScale 0.6s ease-out forwards;
}

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

.book-cover {
    height: 300px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-placeholder {
    font-size: 5rem;
}

.book-info {
    padding: 2rem;
}

.book-info h3 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.book-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
    font-style: italic;
}

.book-description {
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

.book-year {
    color: var(--text-light);
    font-weight: 600;
}

/* ==========================================
   Kapcsolat szekció
   ========================================== */

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info h3,
.contact-form h3 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: var(--spacing-md);
}

.contact-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-item strong {
    color: var(--text-dark);
}

.contact-item div {
    color: var(--text-light);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: var(--spacing-md);
}

.social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    transition: var(--transition);
}

.social-link svg {
    width: 24px;
    height: 24px;
}

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

/* Űrlap */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.form-message {
    margin-top: var(--spacing-sm);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    display: none;
}

.form-message.success {
    background-color: #d1fae5;
    color: #065f46;
    display: block;
}

.form-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    display: block;
}

/* ==========================================
   Footer
   ========================================== */

.footer {
    background-color: var(--text-dark);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-logo {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
    opacity: 0.9;
    transition: var(--transition);
}

.footer-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* ==========================================
   Animációk
   ========================================== */

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
}

.fade-in.visible {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* ==========================================
   Reszponzív design
   ========================================== */

@media (max-width: 768px) {

    /* Navigáció */
    .hamburger {
        display: flex;
    }

    .nav-logo {
        height: 32px;
    }

    .nav-brand span {
        font-size: 1rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link::after {
        display: none;
    }

    /* Hero */
    .hero-section {
        background-attachment: scroll;
        /* Jobb teljesítmény mobilon */
        min-height: 100vh;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-title-prefix,
    .hero-title-suffix {
        font-size: 1.2rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    /* Section title */
    .section-title {
        font-size: 2rem;
    }

    /* Timeline */
    .timeline {
        padding-left: 2rem;
    }

    .timeline-dot {
        left: -2.5rem;
    }

    /* About intro */
    .about-intro {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .profile-image {
        max-width: 200px;
        margin: 0 auto;
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Books */
    .books-grid {
        grid-template-columns: 1fr;
    }

    /* Container padding */
    .container {
        padding: 0 1rem;
    }

    .section {
        padding: var(--spacing-lg) 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .research-grid {
        grid-template-columns: 1fr;
    }
}