/* OnlyJoe SPA styles — YouTube-like, blue theme */
:root {
    --blue: #0ea5e9;
    --blue-700: #0288d1;
    --bg: #f3f6f9;
    --surface: #fff;
    --muted: #6b7280;
    --radius: 10px;
    --max-width: 1100px;
}

* {
    box-sizing: border-box
}

body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: var(--bg);
    color: #111;
    margin: 0
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

.topbar {
    height: 64px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #e6eef6;
    position: sticky;
    top: 0;
    z-index: 80
}

.topbar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--blue)
}

.topbar .logo img {
    height: 36px;
    width: 36px;
    border-radius: 6px
}

.topbar .search {
    flex: 1;
    max-width: 640px;
    margin: 0 20px
}

.topbar .search input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 20px;
    border: 1px solid #e6eef6;
    background: #f7fbfd
}

.topbar .actions {
    display: flex;
    align-items: center;
    gap: 12px
}

.topbar .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%
}

.main {
    display: flex;
    gap: 16px;
    max-width: var(--max-width);
    margin: 20px auto;
    width: 100%;
    padding: 0 16px
}

.sidebar {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.nav-item {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.12), rgba(2, 136, 209, 0.08));
    color: var(--blue);
    font-weight: 600
}

.content {
    flex: 1
}

.feed {
    display: block
}

.profile-header {
    max-width: var(--max-width);
    background: var(--surface);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    box-shadow: 0 6px 0px rgba(16, 24, 40, 0.04)
}

.profile-header .pfp {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden
}

.profile-header .pfp img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.profile-header .info {
    flex: 1
}

.profile-header .info h2 {
    margin: 0;
    font-size: 1.2rem
}

.profile-header .info .handle {
    font-size: .9rem;
    color: var(--blue);
    margin-left: 8px
}

.profile-header .sub {
    color: var(--muted);
    margin-top: 6px
}

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

.card {
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 0px rgba(16, 24, 40, 0.1);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s cubic-bezier(0.075, 0.82, 0.165, 1);
}
.card:hover {
    
    box-shadow: 0 8px 0px rgba(16, 24, 40, 0.3);
    transform: translateY(-4px);
}
.card:active {
    
    box-shadow: 0 0px 0px 5px rgba(16, 24, 40, 1);
    transform: translateY(0px);
}

.card .thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block
}

.card .info {
    padding: 12px
}

.card .title {
    font-weight: 600;
    margin-bottom: 6px
}

.card .meta {
    color: var(--muted);
    font-size: 14px
}

.player {
    max-width: 900px;
    margin: 0 auto
}

.player-inner {
    display: flex;
    gap: 16px;
    align-items: flex-start
}

.player video {
    width: 640px;
    height: 360px;
    background: #000;
    border-radius: 8px
}

.player .meta {
    flex: 1
}

.back {
    background: none;
    border: none;
    color: var(--muted);
    margin-bottom: 10px;
    cursor: pointer
}

.about {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px
}

@media(max-width:900px) {
    .main {
        padding: 0 12px
    }

    .sidebar {
        display: none
    }

    .player video {
        width: 100%;
        height: auto
    }
}

/* small helpers */
.btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 0;
    background: var(--blue);
    color: #fff
}

.btn.ghost {
    background: transparent;
    border: 1px solid #d7eef9;
    color: var(--blue)
}

/* Ensure the shared-element snapshot used by the View Transitions API
   appears above other content during the transition. This prevents the
   zooming video/thumb from rendering behind other .card elements. */
@supports selector(::view-transition-image) {
    ::view-transition-image {
        position: fixed;
        inset: 0;
        z-index: 99999;
        transform-origin: center;
        will-change: transform, opacity;
    }
}

/* Floating action button (subscribe) */
.fab {
    position: fixed;
    right: 20px;
    bottom: 24px;
    background: var(--blue);
    color: #fff;
    padding: 14px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(2,136,209,0.18);
    text-decoration: none;
    font-weight: 700;
    z-index: 100000; /* above view-transition snapshot */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.fab:hover, .fab:focus {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(2,136,209,0.22);
}
.fab:active {
    transform: translateY(0);
}

@media(max-width:600px){
    .fab { right: 12px; bottom: 16px; padding: 12px 14px }
}