*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #0f0f0f;
    --color-surface: #1a1a1a;
    --color-border: #2a2a2a;
    --color-primary: #fe2c55;
    --color-text: #ffffff;
    --color-text-muted: #888888;
    --radius: 12px;
    --gap: 16px;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1;
}

/* Header */
.header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px var(--gap);
    max-width: 1200px;
    margin: 0 auto;
}

.header__title {
    font-weight: 700;
    font-size: 18px;
}

/* Main */
.main {
    padding: var(--gap);
    padding-top: 50px;
    padding-bottom: 50px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 768px) {
    .main {
        max-width: 1400px;
    }

    .video-list {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        align-items: start;
        justify-items: stretch;
    }

    .card {
        max-width: none;
    }
}

/* Login */
.login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 24px;
}

.login__title {
    font-size: 28px;
    font-weight: 700;
}

.login__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
}

.login__error {
    color: var(--color-primary);
    font-size: 14px;
    text-align: center;
}

/* Inputs */
.input {
    width: 100%;
    padding: 14px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 16px;
    outline: none;
}

.input:focus {
    border-color: var(--color-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s;
}

.btn:active {
    opacity: 0.8;
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
}

/* Footer */
.footer {
    padding: 20px var(--gap);
    text-align: center;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.footer__logout {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 20px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    display: inline-block;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: var(--gap);
}

.modal-overlay--visible {
    display: flex;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px var(--gap);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal__title {
    font-size: 18px;
    font-weight: 700;
}

.modal__close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.modal__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.label {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: -6px;
}

.textarea {
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
}

.file-drop {
    position: relative;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 28px 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.file-drop:hover {
    border-color: var(--color-primary);
}

.file-drop__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Empty state */
.empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 48px 0;
}

/* Video list */
@media(max-width: 767px){
    .video-list {
        gap: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

.video-list {
    gap: 20px;
}

/* Card */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
}

.card__video {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
    background: #000;
}

.card__body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card__title {
    font-size: 16px;
    font-weight: 600;
}

.card__desc-block {
    background: var(--color-bg);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card__desc-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card__desc {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.5;
    white-space: pre-wrap;
}

.card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s;
}

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

.btn-icon--copied {
    color: #22c55e;
}

/* Card actions */
.card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card__actions-left,
.card__actions-right {
    display: flex;
    gap: 8px;
}

/* Status buttons */

.status-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-decoration: none;
    flex-shrink: 0;
}

.status-btn:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

.status-btn--done {
    border-color: #22c55e;
    color: #22c55e;
}

.status-btn--danger {
    border-color: transparent;
    color: var(--color-text-muted);
}

.status-btn--danger:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Modal extras */
.modal--sm {
    max-width: 360px;
}

.modal__text {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal__footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn--ghost {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn--danger {
    background: #ef4444;
    color: #fff;
}

.btn--danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
