/* ═══════════════════════════════════════════════════
   clips.css — Styles for /clips page
   Uses CSS variables from landing.css
   ═══════════════════════════════════════════════════ */

/* ── Shell ────────────────────────────────── */
.clips-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    display: flex;
    flex-direction: column;
}

/* ── Header ───────────────────────────────── */
.clips-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 16px;
}
.clips-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--dim);
    text-decoration: none;
    transition: border-color .2s, background .2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.clips-back:hover {
    border-color: rgba(99, 102, 241, .45);
    background: var(--surface2);
    text-decoration: none;
}
.clips-title {
    flex: 1;
    font-family: var(--font-head);
    font-size: clamp(16px, 4vw, 22px);
    letter-spacing: .06em;
    background: linear-gradient(135deg, var(--accent2) 0%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    line-height: 1.2;
}
.clips-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.clips-logo img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: block;
}

/* ── Filter bar ───────────────────────────── */
.clips-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.clips-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--dim);
    font-family: var(--font-head);
    font-size: .6rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: .03em;
    transition: border-color .2s, color .2s, background .2s;
    cursor: pointer;
    white-space: nowrap;
}
.clips-filter-btn:hover {
    border-color: rgba(99, 102, 241, .45);
    color: var(--text);
    text-decoration: none;
}
.clips-filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.clips-filter-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg2);
    color: var(--dim);
    font-family: var(--font-head);
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .03em;
    outline: none;
    cursor: pointer;
    transition: border-color .2s;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23475569'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.clips-filter-select:focus {
    border-color: var(--accent);
}

/* ── Featured clip ────────────────────────── */
.clips-featured {
    margin-bottom: 20px;
}
.clips-featured-card {
    display: block;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: border-color .18s, transform .18s;
}
.clips-featured-card:hover {
    border-color: rgba(99, 102, 241, .5);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}
.clips-featured-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg2);
    overflow: hidden;
}
.clips-featured-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.clips-featured-thumb .clips-play-overlay {
    font-size: 48px;
}
.clips-featured-info {
    padding: 12px 14px;
}
.clips-featured-title {
    font-family: var(--font-head);
    font-size: 14px;
    letter-spacing: .04em;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
}
.clips-featured-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

/* ── Grid ─────────────────────────────────── */
.clips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.clips-section-label {
    font-family: var(--font-head);
    font-size: 13px;
    letter-spacing: .05em;
    color: var(--text);
    margin-bottom: 10px;
}

/* ── Clip card ────────────────────────────── */
.clip-card {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: border-color .18s, transform .18s, background .18s;
}
.clip-card:hover {
    border-color: rgba(99, 102, 241, .5);
    background: var(--surface2);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}
.clip-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg2);
    overflow: hidden;
}
.clip-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Play overlay */
.clips-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .45) 100%);
    font-size: 32px;
    color: #fff;
    opacity: .85;
    transition: opacity .2s;
    pointer-events: none;
}
.clip-card:hover .clips-play-overlay,
.clips-featured-card:hover .clips-play-overlay {
    opacity: 1;
}

/* Duration badge */
.clip-duration-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .7);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    letter-spacing: .03em;
}

/* Card info */
.clip-card-info {
    padding: 8px 10px 10px;
}
.clip-card-title {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.clip-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font-mono);
}
.clip-meta-views {
    font-weight: 600;
    color: var(--dim);
}
.clip-meta-time {
    opacity: .75;
}
.clip-card-mode {
    margin-top: 3px;
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: 600;
    letter-spacing: .03em;
}

/* ── Watch page ───────────────────────────── */
.clips-watch {
    width: 100%;
}

/* Video embed container */
.clips-embed-wrap {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    margin-bottom: 16px;
}
.clips-embed-wrap.landscape {
    aspect-ratio: 16 / 9;
}
.clips-embed-wrap.portrait {
    aspect-ratio: 9 / 16;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}
.clips-embed-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Embed loading state */
.clips-embed-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .3);
    z-index: 2;
}

/* Embed error state */
.clips-embed-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
    aspect-ratio: 16 / 9;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 16px;
}
.clips-embed-error-text {
    font-size: 14px;
    color: var(--muted);
}
.clips-embed-error-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: #fff;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: transform .18s, box-shadow .18s;
}
.clips-embed-error-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, .35);
    text-decoration: none;
    color: #fff;
}

/* Clip info section */
.clips-info {
    margin-bottom: 20px;
}
.clips-info-title {
    font-family: var(--font-head);
    font-size: 16px;
    letter-spacing: .04em;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}
.clips-info-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.clips-stat {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .02em;
}
.clips-stat:not(:first-child)::before {
    content: '\00B7';
    margin-right: 12px;
    color: var(--muted);
}
.clips-info-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--muted);
}
.clips-info-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
}
.clips-info-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--dim);
    margin-bottom: 12px;
}
.clips-info-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--dim);
    text-decoration: none;
    transition: border-color .2s, color .2s;
}
.clips-info-source:hover {
    border-color: rgba(99, 102, 241, .45);
    color: var(--text);
    text-decoration: none;
}

/* Related clips section */
.clips-related {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.clips-related-title {
    font-family: var(--font-head);
    font-size: 13px;
    letter-spacing: .05em;
    color: var(--text);
    margin-bottom: 12px;
}

/* ── Load more ────────────────────────────── */
.clips-load-more {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}
.clips-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: #fff;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform .18s, box-shadow .18s;
}
.clips-load-more-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, .35);
}
.clips-load-more-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Loading / Empty / Error states ───────── */
.clips-loading {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}
.clips-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: clipsSpin 0.8s linear infinite;
}
@keyframes clipsSpin {
    to { transform: rotate(360deg); }
}
.clips-empty {
    text-align: center;
    color: var(--muted);
    padding: 40px 0;
    font-size: 14px;
}
.clips-error {
    text-align: center;
    color: var(--red);
    padding: 40px 0;
    font-size: 14px;
}
.clips-error a {
    color: var(--accent);
}

/* ── Footer ───────────────────────────────── */
.clips-footer {
    margin-top: auto;
    padding-top: 30px;
    text-align: center;
}
.clips-footer-title {
    font-family: var(--font-head);
    font-size: 13px;
    letter-spacing: .05em;
    color: var(--text);
    margin-bottom: 10px;
}
.clips-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}
.clips-footer-copy {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .08em;
}
.clips-footer-copy a {
    color: var(--muted);
    text-decoration: none;
}
.clips-footer-copy a:hover {
    color: var(--text);
}

/* ═══════════════════════════════════════════════
   Responsive breakpoints
   ═══════════════════════════════════════════════ */

/* ── Tablet+ (>=600px) ────────────────────── */
@media (min-width: 600px) {
    .clips-shell {
        max-width: 720px;
        padding: 20px 20px 40px;
    }
    .clips-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .clips-title {
        font-size: 22px;
    }
    .clips-filter-btn {
        font-size: .68rem;
        padding: 9px 14px;
    }
    .clips-filter-select {
        font-size: .68rem;
        padding: 9px 14px;
        padding-right: 28px;
    }
}

/* ── Desktop (>=900px) ────────────────────── */
@media (min-width: 900px) {
    .clips-shell {
        max-width: 960px;
    }
    .clips-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Small phones (<=374px) ───────────────── */
@media (max-width: 374px) {
    .clips-shell {
        padding: 14px 12px 30px;
    }
    .clips-title {
        font-size: 14px;
    }
    .clips-back {
        padding: 6px 8px;
        font-size: 11px;
    }
    .clips-filter-btn {
        padding: 6px 8px;
        font-size: .52rem;
    }
    .clips-filter-select {
        padding: 6px 8px;
        font-size: .52rem;
    }
    .clip-card-info {
        padding: 6px 8px 8px;
    }
    .clip-card-title {
        font-size: 11px;
    }
    .clips-featured-title {
        font-size: 13px;
    }
    .clips-info-title {
        font-size: 14px;
    }
}

/* ── Tags ────────────────────────────────── */
.clip-tag {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.clip-tag:hover {
    text-decoration: underline;
}
.clips-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
}
.clips-tag-clear {
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: .8;
}
.clips-tag-clear:hover { opacity: 1; }

/* ── Comments ────────────────────────────── */
.clips-comments {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    max-width: 720px;
}
.clips-comments-title {
    font-family: var(--font-head);
    font-size: 14px;
    letter-spacing: .04em;
    color: var(--text);
    margin-bottom: 16px;
}
.clips-comment-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: flex-end;
}
.clips-comment-form textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg2);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    outline: none;
    transition: border-color .2s;
}
.clips-comment-form textarea:focus {
    border-color: var(--accent);
}
.clips-comment-form button {
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .18s, opacity .18s;
    min-height: 40px;
}
.clips-comment-form button:hover { transform: translateY(-1px); }
.clips-comment-form button:disabled { opacity: .5; cursor: not-allowed; }
.clips-comment {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.clips-comment:last-child { border-bottom: none; }
.clips-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.clips-comment-name {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.clips-comment-time {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font-mono);
}
.clips-comment-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--red);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: .6;
    transition: opacity .2s;
}
.clips-comment-delete:hover { opacity: 1; }
.clips-comment-content {
    font-size: 13px;
    color: var(--dim);
    line-height: 1.5;
    word-break: break-word;
}
.clips-comment-login {
    text-align: center;
    padding: 16px;
    color: var(--muted);
    font-size: 13px;
    background: var(--bg2);
    border-radius: 10px;
    margin-bottom: 16px;
}
.clips-comment-login a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.clips-comment-empty {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 13px;
}
.clip-meta-comments {
    font-weight: 600;
    color: var(--dim);
}

/* ── Standard phones (375-599px) ──────────── */
@media (min-width: 375px) and (max-width: 599px) {
    .clips-shell {
        padding: 16px 14px 34px;
    }
}
