﻿@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400&display=swap');

:root {
    --nav-width: 250px;
    --nav-transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'Roboto Mono', monospace;
    overflow: hidden;
    display: flex;
}

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

/* ZMĚNA: ODSTRANĚN MARGIN, KTERÝ JSEM PŘIDAL */
.project-list > ul > li {
    /* margin-bottom: 1.2rem;  <-- SMAZÁNO */
}

/* Spacer */
.project-list li.nav-spacer {
    height: 0.1rem;
    margin: 0;
    margin-bottom: 0.5rem;
}

/* Odkazy */
.project-list a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 1rem;
}

.project-list a:hover, .project-list a.active {
    color: #fff;
}

.project-list a.name-link {
    color: #fff !important;
    font-weight: normal;
    font-size: 1rem;
    display: block;
}

/* Nav Row & Arrow */
.nav-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    flex-wrap: nowrap;
    position: relative;
}

.nav-row a {
    display: inline-block !important;
    width: auto !important;
    flex-shrink: 0;
    margin-right: 0;
}

.nav-expand-arrow {
    cursor: pointer;
    padding: 8px;
    margin-left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    position: static !important;
}

.nav-expand-arrow::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #888;
    border-bottom: 2px solid #888;
    transition: transform 0.3s ease, margin-top 0.3s ease;
    transform: rotate(-45deg);
    margin-top: 0;
}

li.open .nav-expand-arrow::after {
    transform: rotate(45deg);
    border-color: #fff;
    margin-top: -3px;
}

/* Sub-nav */
.project-list li > .sub-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-in-out, opacity 0.2s ease-in-out, margin-top 0.1s;
}

.project-list li.open > .sub-nav {
    max-height: 1000px;
    opacity: 1;
    margin-top: 0.8rem;
}

/* ZMĚNA: ODSTRANĚN MARGIN, KTERÝ JSEM PŘIDAL */
.sub-nav-item {
    margin-bottom: 5px; 
}

.sub-nav-item a {
    font-size: 0.9rem;
    color: #888;
    display: block;
}

.sub-nav-item a:hover {
    color: #fff;
}

.sub-nav-item a.active-sub {
    color: #fff;
    font-weight: bold;
}

/* Desktop Nav */
#desktop-nav {
    width: var(--nav-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: #000;
    z-index: 1000;
    transition: transform var(--nav-transition-speed) ease-in-out;
    padding: 1.5rem;
    border-right: 1px solid #333;
}

.desktop-toggle-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -20px;
    width: 40px;
    height: 40px;
    background-color: #000;
    border: 1px solid #333;
    border-left: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desktop-toggle-btn::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid #888;
    border-left: 2px solid #888;
    transform: rotate(-45deg);
    transition: transform 0.2s;
}

body.desktop-nav-closed .desktop-toggle-btn::before {
    transform: rotate(135deg);
}

.desktop-nav-content {
    padding-top: 0;
}

body.desktop-nav-closed #desktop-nav {
    transform: translateX(calc(-1 * var(--nav-width)));
}

/* Content Column */
.content-column {
    margin-left: var(--nav-width);
    width: calc(100% - var(--nav-width));
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: margin-left var(--nav-transition-speed) ease-in-out;
}

body.desktop-nav-closed .content-column {
    margin-left: 0;
    width: 100%;
}

/* Mobile Nav */
#mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    pointer-events: none;
}

.mobile-toggle-btn {
    position: fixed;
    pointer-events: all;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid #333;
    border-radius: 50%;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-toggle-btn::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    margin-top: -3px;
    transition: transform 0.3s ease, margin-top 0.3s ease;
}

.mobile-nav-content {
    padding: 1.5rem;
    background-color: #000;
    display: none;
    pointer-events: all;
    position: relative;
    border-bottom: 1px solid #333;
}

body.mobile-nav-open .mobile-nav-content {
    display: block;
}

body.mobile-nav-open .mobile-toggle-btn {
    position: absolute;
    top: auto;
    bottom: 5px;
    right: 15px;
    background: none;
    backdrop-filter: none;
    border: none;
    width: auto;
    height: auto;
}

body.mobile-nav-open .mobile-toggle-btn::after {
    transform: rotate(225deg);
    margin-top: 5px;
}

/* Visibility */
body {
    display: flex;
}

#mobile-nav {
    display: none !important;
}

#desktop-nav {
    display: block !important;
}

/* Projects */
.projekty-list-container {
    padding: 1.5rem;
    max-width: 900px;
}

.projekty-list-container h1 {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #888;
    text-transform: uppercase;
}

.project-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.project-item-link {
    font-size: 1.5rem;
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.project-item:hover .project-item-link {
    color: #888;
}

.project-preview {
    display: none;
    width: 300px;
    height: 200px;
    border: 1px solid #333;
    background-color: #111;
}

.project-item:hover .project-preview {
    display: block;
}

.project-preview img, .project-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px), (orientation: portrait) {
    #desktop-nav {
        display: none !important;
    }

    #mobile-nav {
        display: block !important;
    }

    body {
        display: block;
    }

    .content-column {
        width: 100%;
        margin-left: 0;
    }

    body.mobile-nav-open .content-column {
        display: block;
    }

    body.desktop-nav-closed .content-column {
        width: 100%;
        margin-left: 0;
    }

    .projekty-list-container {
        padding: 1.5rem 1rem;
    }

    .project-item {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 3rem;
    }

    .project-item-link {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .project-item:hover .project-item-link {
        color: #fff;
    }

    .project-preview {
        display: block;
        width: 100%;
        height: 200px;
    }
}