* {
    box-sizing: border-box;
}


:root {
    --bg: #07090c;
    --panel: #0c1015;
    --panel-hover: #10161d;
    --border: #202932;
    --text: #d7dde4;
    --muted: #697581;
    --accent: #a6ff00;
    --danger: #ff4d67;
}


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


body {
    background: var(--bg);
    color: var(--text);

    font-family:
        "JetBrains Mono",
        "SFMono-Regular",
        Consolas,
        monospace;

    letter-spacing: 0.02em;
}


a {
    color: inherit;
    text-decoration: none;
}


button,
input {
    font: inherit;
}


button {
    cursor: pointer;
}


.shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}


/* -------------------------------------------------------
   Brand
------------------------------------------------------- */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.14em;
}


.brand-mark {
    color: var(--accent);
    font-size: 11px;
}


/* -------------------------------------------------------
   Topbar
------------------------------------------------------- */

.topbar {
    height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}


.topbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}


.user {
    color: var(--muted);
    font-size: 12px;
}


.logout {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.12em;
}


.logout:hover {
    color: var(--accent);
}


/* -------------------------------------------------------
   Dashboard
------------------------------------------------------- */

.dashboard {
    padding: 70px 0 100px;
}


.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    margin-bottom: 45px;
}


.eyebrow {
    color: var(--accent);

    font-size: 10px;
    letter-spacing: 0.18em;

    margin-bottom: 12px;
}


h1 {
    margin: 0;

    font-size: clamp(28px, 5vw, 52px);
    line-height: 1;

    letter-spacing: -0.04em;
}


.system-time {
    color: var(--accent);

    font-size: 10px;
    letter-spacing: 0.18em;
}


/* -------------------------------------------------------
   Statistics
------------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);

    margin-bottom: 35px;
}


.stat {
    padding: 25px 20px;

    border-right: 1px solid var(--border);
}


.stat:last-child {
    border-right: none;
}


.stat span {
    display: block;

    color: var(--muted);

    font-size: 9px;
    letter-spacing: 0.15em;

    margin-bottom: 12px;
}


.stat strong {
    font-size: 28px;
    font-weight: 400;
}


/* -------------------------------------------------------
   Create
------------------------------------------------------- */

.create-panel {
    padding: 24px;

    border: 1px solid var(--border);
    background: var(--panel);

    margin-bottom: 50px;
}


.section-label {
    color: var(--muted);

    font-size: 9px;
    letter-spacing: 0.16em;
}


.create-form {
    display: flex;
    gap: 10px;

    margin-top: 15px;
}


.create-form input {
    flex: 1;

    min-width: 0;

    background: #080b0f;

    border: 1px solid var(--border);

    color: var(--text);

    padding: 13px 15px;

    outline: none;
}


.create-form input:focus {
    border-color: var(--accent);
}


.create-form button,
.login-form button {
    border: 1px solid var(--accent);

    background: var(--accent);
    color: #050605;

    padding: 0 22px;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.12em;
}


.create-form button:hover,
.login-form button:hover {
    filter: brightness(0.88);
}


/* -------------------------------------------------------
   Section header
------------------------------------------------------- */

.section-header {
    display: flex;
    justify-content: space-between;

    margin-bottom: 18px;
}


.section-count {
    color: var(--muted);

    font-size: 9px;
}


/* -------------------------------------------------------
   Albums
------------------------------------------------------- */

.albums-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(240px, 1fr));

    gap: 12px;
}


.album-card {
    min-height: 170px;

    padding: 20px;

    border: 1px solid var(--border);

    background: var(--panel);

    transition:
        border-color 0.15s,
        background 0.15s;
}


.album-card:hover {
    border-color: #3a4652;
    background: var(--panel-hover);
}


.album-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 35px;
}


.album-icon {
    color: var(--accent);
    font-size: 12px;
}


.delete-button {
    border: 0;
    background: transparent;

    color: var(--muted);

    font-size: 20px;
    line-height: 1;

    padding: 0;
}


.delete-button:hover {
    color: var(--danger);
}


.album-name {
    font-size: 16px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    margin-bottom: 14px;
}


.album-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;

    color: var(--muted);

    font-size: 8px;
}


/* -------------------------------------------------------
   Empty state
------------------------------------------------------- */

.empty-state {
    padding: 80px 20px;

    border: 1px dashed var(--border);

    text-align: center;
}


.empty-icon {
    color: var(--accent);

    font-size: 32px;

    margin-bottom: 20px;
}


.empty-state h2 {
    margin: 0 0 12px;

    font-size: 18px;
    font-weight: 400;
}


.empty-state p {
    margin: 0;

    color: var(--muted);

    font-size: 11px;
}


.hint {
    margin-top: 25px;

    color: var(--muted);

    font-size: 8px;
    letter-spacing: 0.16em;
}


/* -------------------------------------------------------
   Login
------------------------------------------------------- */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;
}


.login-card {
    width: min(420px, 100%);

    padding: 45px;

    border: 1px solid var(--border);

    background: var(--panel);
}


.login-brand {
    margin-bottom: 45px;
}


.login-card h1 {
    font-size: 30px;

    margin-bottom: 30px;
}


.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.login-form label {
    color: var(--muted);

    font-size: 9px;
    letter-spacing: 0.15em;

    margin-top: 8px;
}


.login-form input {
    width: 100%;

    padding: 14px;

    background: #080b0f;

    border: 1px solid var(--border);

    color: var(--text);

    outline: none;
}


.login-form input:focus {
    border-color: var(--accent);
}


.login-form button {
    height: 45px;

    margin-top: 15px;
}


.error-message {
    padding: 12px;

    border: 1px solid var(--danger);

    color: var(--danger);

    font-size: 9px;
    letter-spacing: 0.08em;

    margin-bottom: 15px;
}


/* -------------------------------------------------------
   Mobile
------------------------------------------------------- */

@media (max-width: 650px) {

    .shell {
        width: min(100% - 24px, 1180px);
    }


    .dashboard {
        padding-top: 45px;
    }


    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
    }


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


    .stat {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }


    .stat:last-child {
        border-bottom: 0;
    }


    .create-form {
        flex-direction: column;
    }


    .create-form button {
        height: 44px;
    }


    .topbar-right {
        gap: 12px;
    }


    .user {
        display: none;
    }


    .login-card {
        padding: 30px;
    }

}


/* -------------------------------------------------------
   Album
------------------------------------------------------- */

.back-link {
    color: var(--muted);

    font-size: 9px;
    letter-spacing: 0.12em;
}

.back-link:hover {
    color: var(--accent);
}


/* -------------------------------------------------------
   Upload
------------------------------------------------------- */

.upload-form {
    display: flex;
    gap: 12px;
    align-items: center;

    margin-top: 15px;
}


.upload-form input[type="file"] {
    flex: 1;

    min-width: 0;

    color: var(--muted);

    border: 1px solid var(--border);

    padding: 10px;

    background: #080b0f;
}


.upload-form button {
    height: 43px;

    padding: 0 25px;

    border: 1px solid var(--accent);

    background: var(--accent);
    color: #050605;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.12em;
}


.upload-hint {
    color: var(--muted);

    font-size: 8px;

    margin-top: 12px;

    letter-spacing: 0.08em;
}


/* -------------------------------------------------------
   Media grid
------------------------------------------------------- */

.media-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(220px, 1fr));

    gap: 12px;
}


.media-card {
    overflow: hidden;

    border: 1px solid var(--border);

    background: var(--panel);
}


.media-preview {
    display: block;

    width: 100%;
    aspect-ratio: 1 / 1;

    background: #05070a;

    overflow: hidden;
}


.media-preview img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transition: transform 0.2s;
}


.media-preview:hover img {
    transform: scale(1.03);
}


.video-placeholder {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 12px;

    color: var(--muted);

    background:
        repeating-linear-gradient(
            45deg,
            #080b0f,
            #080b0f 10px,
            #0b0f14 10px,
            #0b0f14 20px
        );
}


.video-placeholder span {
    font-size: 9px;
    letter-spacing: 0.16em;
}


.video-placeholder strong {
    color: var(--accent);

    font-size: 28px;
}


/* -------------------------------------------------------
   Media info
------------------------------------------------------- */

.media-info {
    padding: 15px;
}


.media-name {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    font-size: 11px;

    margin-bottom: 12px;
}


.media-meta {
    display: flex;
    justify-content: space-between;

    color: var(--muted);

    font-size: 8px;

    margin-bottom: 14px;
}


.media-delete {
    padding: 0;

    border: 0;

    background: transparent;

    color: var(--muted);

    font-size: 8px;

    letter-spacing: 0.12em;
}


.media-delete:hover {
    color: var(--danger);
}


@media (max-width: 650px) {

    .upload-form {
        flex-direction: column;
        align-items: stretch;
    }

    .upload-form button {
        width: 100%;
    }

    .media-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

/* -------------------------------------------------------
   Video player
------------------------------------------------------- */

.video-player {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    background: #05070a;
}

/* -------------------------------------------------------
   Video thumbnails
------------------------------------------------------- */

.video-thumbnail {
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;

    background: #05070a;
}


.video-thumbnail img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transition: transform 0.2s;
}


.video-thumbnail:hover img {
    transform: scale(1.03);
}


.video-overlay {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    pointer-events: none;
}


.video-overlay span {
    width: 54px;
    height: 54px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 1px solid var(--accent);

    background: rgba(0, 0, 0, 0.72);

    color: var(--accent);

    font-size: 20px;

    padding-left: 3px;
}


/* -------------------------------------------------------
   Video viewer
------------------------------------------------------- */

.viewer {
    max-width: 1400px;

    margin: 0 auto;

    padding: 40px 24px;
}


.viewer-header {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}


.viewer-header h1 {
    margin: 5px 0 0;

    font-size: 22px;

    word-break: break-word;
}


.video-container {
    width: 100%;

    background: #030405;

    border: 1px solid var(--border);
}


.video-container video {
    display: block;

    width: 100%;
    max-height: 80vh;

    margin: 0 auto;
}


.viewer-meta {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding: 14px 0;

    color: var(--muted);

    font-size: 9px;

    letter-spacing: 0.08em;
}


@media (max-width: 650px) {

    .viewer {
        padding: 25px 15px;
    }

    .viewer-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .viewer-header h1 {
        font-size: 17px;
    }

}

/* -------------------------------------------------------
   Image viewer
------------------------------------------------------- */

.image-container {
    width: 100%;

    min-height: 300px;

    display: flex;

    align-items: center;
    justify-content: center;

    background: #030405;

    border: 1px solid var(--border);

    padding: 20px;

    box-sizing: border-box;
}


.image-container img {
    display: block;

    max-width: 100%;
    max-height: 80vh;

    width: auto;
    height: auto;

    object-fit: contain;
}

.viewer-stage {
    width: 100%;
    min-height: 400px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #030405;
    border: 1px solid var(--border);

    padding: 20px;
    box-sizing: border-box;
}

.viewer-stage img {
    display: block;

    max-width: 100%;
    max-height: 75vh;

    width: auto;
    height: auto;

    object-fit: contain;
}

.viewer-stage video {
    display: block;

    width: 100%;
    max-height: 75vh;

    background: #000;
}

.viewer-controls {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 16px 0;
}

.viewer-navigation,
.viewer-actions {
    display: flex;

    align-items: center;

    gap: 8px;
}

.viewer-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 36px;

    padding: 0 14px;

    border: 1px solid var(--border);

    background: transparent;

    color: var(--text);

    font-size: 10px;

    letter-spacing: 0.08em;

    text-decoration: none;

    cursor: pointer;
}

.viewer-button:hover {
    border-color: var(--accent);

    color: var(--accent);
}

.viewer-button.disabled {
    opacity: 0.25;

    cursor: default;
}

.viewer-button.danger {
    color: #ff5c5c;

    border-color: #402020;
}

.viewer-button.danger:hover {
    border-color: #ff5c5c;
}

.viewer-actions form {
    margin: 0;
}

@media (max-width: 650px) {

    .viewer-controls {
        flex-direction: column;

        align-items: stretch;
    }

    .viewer-navigation,
    .viewer-actions {
        justify-content: space-between;
    }

    .viewer-button {
        flex: 1;
    }

}
