:root {
    --background: #f3f6f4;
    --surface: #ffffff;
    --surface-muted: #f8faf9;
    --text: #17231d;
    --text-muted: #65736b;
    --border: #dce5df;
    --primary: #11a9cc;
    --primary-dark: #0c7187;
    --accent: #d7f238;
    --danger: #b93838;
    --shadow: 0 8px 24px rgba(25, 54, 39, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
    font-weight: 400;
    text-decoration: none;
    font-size: clamp(0.85rem, 0.4vw, 1rem);
    gap: 1.25rem;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    width: min(100% - 32px, 1040px);
    min-height: calc(100vh - 104px);
    margin: 20px auto 0;
}

.site-header {
    display: flex;
    position: sticky;
    z-index: 100;
    top: 8px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 3px 14px rgba(25, 54, 39, 0.05);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand:hover {
    color: var(--text);
}

.brand-logo {
    width: 38px;
    height: 38px;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size: 0.92rem;
}

.welcome {
    color: var(--text-muted);
    font-weight: 400;
}

.nav-active {
    color: #11a9cc;
    font-weight: 700;
}

.nav-register {
    padding: 8px 13px;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
}

.nav-register:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.logout-form,
.video-actions form {
    margin: 0;
}

.button-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-size: clamp(0.85rem, 0.4vw, 1rem);
    font-weight: 400;
    cursor: pointer;
}

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

.content-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 34px 0 20px;
}

.content-heading h1 {
    margin: 2px 0 0;
    font-size: clamp(.9rem, 2vw, 1.3rem);
    letter-spacing: -0.035em;
    line-height: 1;
}

.eyebrow {
    margin: 0;
    color: var(--primary);
    font-size: clamp(.3rem, 1.5vw, .8rem);
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.video-count {
    display: grid;
    min-width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #26340e;
    font-weight: 800;
}

.search-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 0 18px 10px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 5px 16px rgba(23, 43, 56, 0.09);
}

.search-field {
    flex: 1;
    min-width: 220px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #34473d;
    font-size: 0.88rem;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #c9d5ce;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus {
    border-color: var(--primary);
    outline: 2px solid rgba(23, 107, 69, 0.12);
}

button,
.button-primary,
.button-success,
.button-secondary {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover,
.button-primary:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.button-secondary {
    background: #e8eeea;
    color: #3e5147;
}

.button-secondary:hover {
    background: #dce5df;
    color: #27382f;
}

.button-success {
    background: #277b57;
}

.button-success:hover {
    background: #1d6245;
    color: #ffffff;
}

.button-danger {
    background: var(--danger);
}

.button-danger:hover {
    background: #982e2e;
}

.video-card {
    overflow: hidden;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.video-details h2 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: .8rem;
}

.video-metadata {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-muted);
}

.video-metadata p {
    margin: 0;
    color: var(--text-muted);
    overflow-wrap: anywhere;
    font-size: 0.7rem;
    line-height: .9rem;
}

.video-metadata strong {
    color: var(--text);
}

.video-player {
    display: flex;
    justify-content: center;
    /* margin: 14px 0; */
}

.video-player video {
    display: block;
    width: 100%;
    border-radius: 10px;
    background: #0d1210;
}

.video-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.video-actions a,
.video-actions button {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 0.8rem;
}

.empty-state {
    padding: 42px 20px;
    border: 1px dashed #bdcbc3;
    border-radius: 14px;
    background: var(--surface);
    color: var(--text-muted);
    text-align: center;
}

.empty-state p {
    margin: 0;
}

.container > form:not(.search-form) {
    max-width: 620px;
    margin: 28px auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.container > h1,
.container > p {
    max-width: 620px;
    margin-right: auto;
    margin-left: auto;
}

.container > h1 {
    margin-top: 32px;
}

.error,
.errorlist {
    color: var(--danger);
}

.login-submit {
    margin-top: 12px;
}

.site-footer {
    padding: 22px 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.site-footer p {
    margin: 1px 0;
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 20px, 1040px);
        margin-top: 10px;
    }

    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px 14px;
    }

    .welcome {
        width: 100%;
    }

    .search-form {
        align-items: stretch;
        flex-direction: column;
        margin-right: 0;
        margin-left: 0;
    }

    .search-field {
        min-width: 0;
    }

    .video-card {
        padding: 16px;
    }
}

@media (max-width: 1000px) {
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

.container {
    width: min(100% - 64px, 1200px);
    margin-top: 8px;
}

.site-header {
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 5px 16px rgba(23, 43, 56, 0.09);
}

.header-blur-layer {
    position: fixed;
    z-index: 99;
    top: 0;
    left: 50%;
    width: min(calc(100% - 64px), 1404px);
    height: 80px;
    transform: translateX(-50%);
    background: rgb(243, 246, 244);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    pointer-events: none;
}

@media (max-width: 760px) {
    .header-blur-layer {
        width: calc(100% - 20px);
    }
}

.brand-logo {
    width: 48px;
    height: 48px;
}

.brand-copy {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    line-height: 1.05;
}

.brand-copy strong {
    color: var(--text);
    font-size: 1.65rem;
    letter-spacing: -0.035em;
    font-weight: 600;
}

.brand-copy small {
    margin-top: 4px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
}

.content-heading {
    margin: 10px 18px 10px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 18px;
}

.video-card {
    display: flex;
    padding: 16px 18px;
    border-radius: 12px;
    flex-direction: column;
}

.video-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.video-card-heading h2 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: .9rem;
}

.video-player video {
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    object-fit: cover;
}

.video-metadata {
    padding: 0;
    background: transparent;
}

.video-metadata p {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #273444;
    font-size: 0.82rem;
    line-height: 1.2;
}

.video-metadata .video-creator {
    color: var(--text-muted);
}

.video-metadata .video-stats {
    color: var(--text-muted);
}

.video-stats-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.share-button {
    display: inline-flex;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.share-button:hover {
    background: var(--surface-muted);
    color: var(--primary);
}

.metadata-icon {
    display: inline-flex;
    width: 14px;
    color: #687785;
    justify-content: center;
    flex: 0 0 14px;
    font-size: 0.75rem;
}

.sr-only {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.video-actions {
    justify-content: flex-end;
    margin-top: auto;
}

.video-actions a,
.video-actions button {
    min-width: 112px;
}

.button-primary {
    border: 1px solid var(--primary);
    background: #ffffff;
    color: var(--primary);
}

.button-primary:hover {
    background: #eefbfe;
    color: var(--primary-dark);
}

.button-success {
    background: var(--primary);
}

.button-success:hover {
    background: var(--primary-dark);
}

.site-footer {
    width: min(100% - 80px, 1100px);
    padding: 18px 16px 26px;
    border-top: 1px solid var(--border);
    margin: 18px auto 0;
}

@media (max-width: 1050px) {
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 20px, 1200px);
    }

    .content-heading {
        margin-right: 0;
        margin-left: 0;
    }

    .video-grid {
        padding: 0;
    }
}

@media (max-width: 600px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .brand-copy strong {
        font-size: 1.35rem;
    }

    .brand-copy small {
        font-size: 0.85rem;
    }
}
