* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #07101d;
    color: #e9fbff;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    overflow: hidden;
}

.background-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 190, 255, 0.2), transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(140, 80, 255, 0.18), transparent 35%),
        linear-gradient(135deg, #050914, #081827 55%, #050914);
}

.background-grid::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(120, 230, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 230, 255, 0.06) 1px, transparent 1px);
    background-size: 42px 42px;
    animation: gridMove 18s linear infinite;
}

@keyframes gridMove {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(42px, 42px);
    }
}

.site-shell {
    display: grid;
    grid-template-columns: 310px 1fr;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    height: 100vh;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(5, 12, 24, 0.82);
    border-right: 1px solid rgba(126, 231, 255, 0.22);
    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.8rem;
    border-radius: 18px;
    background: rgba(126, 231, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(126, 231, 255, 0.16);
}

.brand-mark {
    background-image: url(logo.png);
    background-size: cover;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #7ee7ff;
    box-shadow: 0 0 18px rgba(126, 231, 255, 0.35);
}

.brand h1 {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand p {
    margin: 0.15rem 0 0;
    color: #9fcbd6;
    font-size: 0.82rem;
}

.home-link {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 14px;
    color: #ffffff;
    text-decoration: none;
    background: rgba(80, 200, 255, 0.11);
    box-shadow: inset 0 0 0 1px rgba(120, 220, 255, 0.17);
}

.home-link:hover,
.home-link.active {
    background: rgba(80, 200, 255, 0.2);
    box-shadow:
        inset 0 0 0 1px rgba(120, 220, 255, 0.38),
        0 0 18px rgba(80, 200, 255, 0.18);
}

.folder-tree {
    list-style: none;
    padding-left: 0.5rem;
    margin: 0;
}

.folder-tree .folder-tree {
    padding-left: 0.85rem;
    margin-left: 0.45rem;
    border-left: 1px solid rgba(120, 220, 255, 0.18);
}

.folder-node {
    margin: 0.12rem 0;
}

.folder-node details {
    border-radius: 12px;
}

.folder-node summary {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    padding: 0.42rem 0.5rem;
    border-radius: 12px;
    color: #dff8ff;
    user-select: none;
}

.folder-node summary::marker {
    display: none;
    content: "";
}

.folder-node summary::-webkit-details-marker {
    display: none;
}

.folder-node summary:hover,
.folder-node.active > details > summary {
    background: rgba(80, 200, 255, 0.13);
    box-shadow: inset 0 0 0 1px rgba(120, 220, 255, 0.18);
}

.folder-node a {
    color: inherit;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-arrow {
    color: #7ee7ff;
    font-size: 0.72rem;
    transition: transform 0.18s ease;
}

.folder-node details[open] > summary .folder-arrow {
    transform: rotate(90deg);
}

.main-content {
    height: 100vh;
    overflow-y: auto;
    padding: 1.25rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(5, 12, 24, 0.65);
    box-shadow: inset 0 0 0 1px rgba(126, 231, 255, 0.17);
    backdrop-filter: blur(12px);
}

.content-header h2 {
    margin: 0;
    font-size: 1.7rem;
}

.content-header p {
    margin: 0.3rem 0 0;
    color: #9fcbd6;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.folder-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 74px;
    padding: 0.85rem;
    border-radius: 18px;
    color: #e9fbff;
    text-decoration: none;
    background: rgba(8, 18, 34, 0.74);
    box-shadow: inset 0 0 0 1px rgba(126, 231, 255, 0.16);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.folder-card:hover {
    transform: translateY(-2px);
    background: rgba(20, 42, 68, 0.86);
    box-shadow:
        inset 0 0 0 1px rgba(126, 231, 255, 0.32),
        0 0 24px rgba(80, 200, 255, 0.14);
}

.folder-card-icon {
    color: #7ee7ff;
    font-size: 1.2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.media-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.65rem;
    border: 0;
    border-radius: 18px;
    color: #e9fbff;
    cursor: pointer;
    text-align: left;
    background: rgba(8, 18, 34, 0.78);
    box-shadow: inset 0 0 0 1px rgba(126, 231, 255, 0.15);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.media-card:hover {
    transform: translateY(-3px);
    background: rgba(20, 42, 68, 0.88);
    box-shadow:
        inset 0 0 0 1px rgba(126, 231, 255, 0.35),
        0 0 26px rgba(80, 200, 255, 0.16);
}

.media-card img,
.video-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 14px;
    background: #091423;
}

.media-card span {
    font-size: 0.86rem;
    color: #cdeef5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-placeholder {
    display: grid;
    place-items: center;
    color: #7ee7ff;
    font-size: 2.2rem;
    box-shadow: inset 0 0 32px rgba(126, 231, 255, 0.12);
}

.empty-state {
    padding: 2rem;
    border-radius: 22px;
    color: #9fcbd6;
    text-align: center;
    background: rgba(8, 18, 34, 0.7);
    box-shadow: inset 0 0 0 1px rgba(126, 231, 255, 0.15);
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    place-items: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
}

.overlay.open {
    display: grid;
}

.overlay-content {
    max-width: 94vw;
    max-height: 90vh;
}

.overlay-content img,
.overlay-content video {
    max-width: 94vw;
    max-height: 90vh;
    border-radius: 18px;
    box-shadow: 0 0 36px rgba(126, 231, 255, 0.25);
}

.overlay-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(126, 231, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(126, 231, 255, 0.28);
}

.overlay-close:hover {
    background: rgba(126, 231, 255, 0.28);
}

@media (max-width: 850px) {
    body {
        overflow: auto;
    }

    .site-shell {
        display: block;
        height: auto;
    }

    .sidebar {
        height: auto;
        max-height: 45vh;
        border-right: 0;
        border-bottom: 1px solid rgba(126, 231, 255, 0.22);
    }

    .main-content {
        height: auto;
        overflow: visible;
    }
}
