/* Reset a základní styly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f1a0f 0%, #1a2e1a 50%, #162e21 100%);
    color: #e0ede0;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #4afe6b, #00fe64);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-links a {
    color: #e0ede0;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(45deg, #4afe6b, #00fe64);
    transition: width 0.3s ease;
}

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

.nav-links a:hover {
    color: #4afe6b;
}

/* Main Content */
main {
    margin-top: 80px;
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: radial-gradient(circle at center, rgba(74, 254, 107, 0.1) 0%, transparent 70%);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #4afe6b, #00fe64);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(45deg, #4afe6b, #00fe64);
    color: black;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(74, 254, 107, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 254, 107, 0.4);
}

/* About a další sekce */
.about {
    padding: 4rem 0;
}

.recent-projects {
    padding: 4rem 0;
}

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

.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(45deg, #4afe6b, #00fe64);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.card h3 {
    color: #4afe6b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    color: #4afe6b;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(45deg, #4afe6b, #00fe64);
    border-radius: 2px;
}

/* Project Grid */
.project {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #4afe6b;
    transition: all 0.3s ease;
}

.project:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.project h4 {
    color: #4afe6b;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.project-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.status-active {
    background: rgba(0, 255, 127, 0.2);
    color: #00ff7f;
}

.status-planned {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-completed {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

/* Expandable Projects */
.expandable-project {
    cursor: pointer;
    overflow: hidden;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.project-header-content {
    flex: 1;
}

.project-short {
    margin: 0.5rem 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.expand-icon {
    font-size: 1.2rem;
    color: #4afe6b;
    transition: transform 0.3s ease;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.expandable-project.expanded .expand-icon {
    transform: rotate(180deg);
}

.project-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.expandable-project.expanded .project-content {
    max-height: 2000px;
}

.project-details {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(74, 254, 107, 0.2);
    margin-top: 1rem;
}

.project-details h5 {
    color: #4afe6b;
    margin-bottom: 0.8rem;
    margin-top: 1.5rem;
    font-size: 1.1rem;
}

.project-details h5:first-child {
    margin-top: 0;
}

.project-description p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tech-tag {
    background: linear-gradient(135deg, green 10%, #4afe6b 100%);
    color: black;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-features ul {
    list-style: none;
    padding-left: 0;
}

.project-features li {
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
}

.project-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4afe6b;
    font-weight: bold;
}

.schema-container {
    background: rgba(74, 254, 107, 0.05);
    border: 2px dashed rgba(74, 254, 107, 0.3);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-link {
    background: linear-gradient(135deg, #4caf50 0%, #4caf50 100%);
    color: black;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 254, 107, 0.4);
}

/* Stránky pro obsah */
.content-page {
    padding: 2rem 0;
    min-height: calc(100vh - 160px);
}

.content-page h1 {
    color: #4afe6b;
    margin-bottom: 2rem;
    text-align: center;
}

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

.tutorial-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.tutorial-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}

.tutorial-card h3 {
    color: #4afe6b;
    margin-bottom: 1rem;
}

/* Sekce pro 3D rendery z KiCadu */
.project-renders {
    margin-top: 1.5rem;
}

.render-gallery {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
    justify-content: center; /* Zobrazí zmenšené obrázky uprostřed sekce */
}

.render-item {
    flex: 0 1 280px;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(74, 254, 107, 0.2);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: border-color 0.3s ease;
    
    /* TATO ČÁST ZAJISTÍ OTOČENÍ A SPRÁVNÉ ZOBRAZENÍ */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.render-item:hover {
    border-color: #4afe6b; /* Při najetí myší se rámeček rozsvítí */
}

.render-item img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    
    /* VYMEZENÍ PROSTORU: Protože otočený obrázek na výšku 
       potřebuje místo do stran, přidáme vertikální odsazení */
    margin: 40px 0; 
}

.render-caption {
    display: block;
    font-size: 0.85rem;
    color: #a0bda0;
    margin-top: 6px;
    font-style: italic;
}

/* Odkazy v kartách a potvrzení zkopírování e-mailu */
.card a {
    color: #4afe6b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card a:hover {
    color: #00fe64;
    text-decoration: underline;
}

.copied-note {
    margin-left: 0.5rem;
    font-size: 0.9rem;
    color: #4afe6b;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copied-note.visible {
    opacity: 1;
}

/* Zvětšení obrázků (lightbox) */
.render-item img {
    cursor: zoom-in;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(5, 12, 5, 0.92);
    backdrop-filter: blur(4px);
    overflow: hidden; /* přiblížená fotka se ořízne až okrajem obrazovky */
}

.lightbox.open {
    display: flex;
}

.lightbox-figure {
    max-width: min(90vw, 1000px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.lightbox-stage {
    position: relative;
    z-index: 1;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    line-height: 0;
}

.lightbox-img {
    max-width: min(90vw, 1000px);
    max-height: calc(90vh - 3rem);
    object-fit: contain;
    cursor: zoom-in;
    transform-origin: center center;
    transition: transform 0.25s ease;
    user-select: none;
    touch-action: none;
}

.lightbox.zoomed .lightbox-img {
    cursor: grab;
}

.lightbox.zoomed .lightbox-stage {
    box-shadow: none;
}

.lightbox.zoomed .lightbox-caption,
.lightbox.zoomed .lightbox-prev,
.lightbox.zoomed .lightbox-next {
    visibility: hidden; /* při přiblížení nic nepřekrývá fotku, zůstává jen křížek */
}

.lightbox.dragging .lightbox-img {
    cursor: grabbing;
    transition: none;
}

.lightbox-caption {
    color: #a0bda0;
    font-style: italic;
}

.lightbox button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: rgba(74, 254, 107, 0.1);
    border: 1px solid rgba(74, 254, 107, 0.4);
    border-radius: 50%;
    color: #4afe6b;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 2; /* tlačítka zůstávají nad přiblíženou fotkou */
    backdrop-filter: blur(4px);
}

.lightbox-prev,
.lightbox-next {
    position: relative;
}

.lightbox button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lightbox button:hover {
    background: rgba(74, 254, 107, 0.25);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.lightbox.single .lightbox-prev,
.lightbox.single .lightbox-next {
    display: none;
}

@media (max-width: 600px) {
    .lightbox {
        padding: 1rem 0.5rem;
        gap: 0.25rem;
    }

    .lightbox button {
        width: 40px;
        height: 40px;
    }

    .lightbox button svg {
        width: 20px;
        height: 20px;
    }
}

/* ===== Mobilní zobrazení ===== */

/* Hamburger menu – na počítači skryté */
.mobile-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu span {
    display: block;
    height: 3px;
    width: 100%;
    border-radius: 2px;
    background: #4afe6b;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Rozkliknutý projekt nezajede pod horní lištu */
.expandable-project {
    scroll-margin-top: 90px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    /* Menu */
    nav {
        position: relative;
        padding: 0.6rem 0;
    }

    .mobile-menu {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: -16px;
        right: -16px;
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
        background: #0d1a0d;
        border-bottom: 1px solid rgba(74, 254, 107, 0.2);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        display: block;
        padding: 0.85rem 32px;
        font-size: 1.05rem;
    }

    .nav-links a::after {
        display: none;
    }

    main {
        margin-top: 64px;
        padding: 1rem 0;
    }

    /* Nadpisy */
    .hero {
        padding: 2.5rem 0;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.25;
        overflow-wrap: break-word;
    }

    .content-page h1 {
        font-size: 1.8rem;
        margin-bottom: 1.25rem;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }

    .content-page .section-title {
        margin-top: 2rem;
    }

    .about,
    .recent-projects {
        padding: 2rem 0;
    }

    /* Karty a projekty */
    .cards-grid,
    .tutorial-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .card {
        padding: 1.5rem;
    }

    .project {
        padding: 1.25rem;
    }

    .project:hover {
        transform: none;
    }

    .project h4 {
        font-size: 1.1rem;
    }

    .render-item {
        flex-basis: 100%;
        max-width: 320px;
    }

    .render-item img {
        margin: 16px 0;
    }

    .schema-container {
        padding: 1rem;
    }
}
