/* ──────────────────────────────────────────────────────────────────────────────
   Circle — Social Layer for Cinephile
   A premium, activity-first social page.
   ────────────────────────────────────────────────────────────────────────────── */

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.circle-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 100px 16px 100px;
    min-height: 100vh;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
.circle-header {
    margin-bottom: 28px;
}

.circle-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.circle-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #fff 40%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.circle-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim, #a0a0a0);
    font-weight: 400;
    margin: 0 0 0 2px;
    letter-spacing: 0.01em;
}

/* ─── Section Headers ───────────────────────────────────────────────────────── */
.circle-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim, #a0a0a0);
    margin: 32px 0 16px;
    padding-left: 2px;
}

.circle-section-title:first-of-type {
    margin-top: 20px;
}

/* ─── Activity Feed ─────────────────────────────────────────────────────────── */
.circle-feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.circle-activity-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.circle-activity-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.circle-activity-card:active {
    transform: scale(0.99);
}

/* Recommendation card glow */
.circle-activity-card.type-recommendation {
    border-color: rgba(124, 77, 255, 0.15);
    background: rgba(124, 77, 255, 0.04);
}

.circle-activity-card.type-recommendation::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: radial-gradient(ellipse at top left, rgba(124, 77, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* Live watching indicator */
.circle-activity-card.type-watching {
    border-color: rgba(74, 222, 128, 0.12);
}

/* ─── Activity Avatar ───────────────────────────────────────────────────────── */
.circle-activity-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.circle-activity-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s;
}

.circle-activity-card:hover .circle-activity-avatar {
    border-color: rgba(124, 77, 255, 0.4);
}

.circle-live-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4ade80;
    border: 2px solid var(--bg-dark, #0a0a0b);
    animation: circlePulse 2s ease-in-out infinite;
}

@keyframes circlePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0); }
}

/* ─── Activity Content ──────────────────────────────────────────────────────── */
.circle-activity-body {
    flex: 1;
    min-width: 0;
}

.circle-activity-text {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-dim, #a0a0a0);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.circle-activity-text strong {
    color: var(--text-main, #fff);
    font-weight: 600;
}

.circle-activity-text .circle-movie-name {
    color: #c4b5fd;
    font-weight: 600;
}

.circle-activity-stars {
    color: #f59e0b;
    font-size: 0.72rem;
    letter-spacing: 1px;
    display: inline;
}

.circle-activity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
}

.circle-activity-type-badge {
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-watching {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
}

.badge-rated {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-watchlist {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
}

.badge-recommendation {
    background: rgba(124, 77, 255, 0.12);
    color: #a78bfa;
}

/* ─── Activity Movie Poster ─────────────────────────────────────────────────── */
.circle-activity-poster {
    width: 42px;
    height: 62px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Your Following — Horizontal Scroll ────────────────────────────────────── */
.circle-following-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 0 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.circle-following-scroll::-webkit-scrollbar {
    display: none;
}

.circle-following-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s;
    min-width: 64px;
}

.circle-following-item:hover {
    transform: translateY(-2px);
}

.circle-following-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(124, 77, 255, 0.25);
    transition: border-color 0.2s;
}

.circle-following-item:hover .circle-following-avatar {
    border-color: rgba(124, 77, 255, 0.6);
}

.circle-following-name {
    font-size: 0.68rem;
    color: var(--text-dim, #a0a0a0);
    text-align: center;
    max-width: 64px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* ─── Suggested People ──────────────────────────────────────────────────────── */
.circle-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.circle-suggest-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    transition: background 0.15s;
    cursor: pointer;
}

.circle-suggest-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.circle-suggest-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.circle-suggest-info {
    flex: 1;
    min-width: 0;
}

.circle-suggest-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-main, #fff);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.circle-suggest-meta {
    font-size: 0.75rem;
    color: var(--text-dim, #a0a0a0);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.circle-suggest-username {
    color: var(--accent-purple, #7c4dff);
    font-weight: 500;
}

.circle-suggest-tag {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* ─── Follow Button ─────────────────────────────────────────────────────────── */
.circle-follow-btn {
    flex-shrink: 0;
    padding: 7px 18px;
    border-radius: 22px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
    min-width: 82px;
    text-align: center;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    min-height: 36px;
}

.circle-follow-btn.not-following {
    background: var(--accent-purple, #7c4dff);
    color: white;
    border: none;
}

.circle-follow-btn.not-following:hover {
    background: #9061f9;
    transform: translateY(-1px);
}

.circle-follow-btn.following {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main, #fff);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.circle-follow-btn.following:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.circle-follow-btn.self-btn {
    display: none;
}

/* ─── Search ────────────────────────────────────────────────────────────────── */
.circle-search-section {
    position: sticky;
    top: 60px; /* Adjust based on navbar height */
    z-index: 100;
    background: var(--bg-dark, #0a0a0b);
    padding: 10px 0;
    margin-bottom: 20px;
}

/* Ensure a slight gradient/shadow when scrolling */
.circle-search-section::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to bottom, var(--bg-dark, #0a0a0b), transparent);
    pointer-events: none;
}

.circle-search-bar {
    position: relative;
    margin-bottom: 16px;
}

.circle-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim, #a0a0a0);
    font-size: 0.82rem;
    pointer-events: none;
}

.circle-search-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    color: var(--text-main, #fff);
    font-size: 0.88rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    min-height: 46px;
}

.circle-search-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.circle-search-input:focus {
    border-color: rgba(124, 77, 255, 0.5);
    background: rgba(255, 255, 255, 0.06);
}

.circle-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-dark, #0a0a0b);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 101;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.circle-search-loading {
    text-align: center;
    padding: 28px;
    color: var(--text-dim, #a0a0a0);
    font-size: 0.85rem;
}

.circle-search-loading i {
    margin-right: 6px;
}

/* ─── Empty States ──────────────────────────────────────────────────────────── */
.circle-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-dim, #a0a0a0);
}

.circle-empty-icon {
    font-size: 2.8rem;
    margin-bottom: 18px;
    opacity: 0.2;
    display: block;
}

.circle-empty h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-main, #fff);
}

.circle-empty p {
    font-size: 0.88rem;
    margin: 0 0 24px;
    line-height: 1.5;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.circle-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    background: rgba(124, 77, 255, 0.12);
    border: 1px solid rgba(124, 77, 255, 0.3);
    color: #a78bfa;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    min-height: 44px;
}

.circle-empty-cta:hover {
    background: rgba(124, 77, 255, 0.22);
    border-color: rgba(124, 77, 255, 0.5);
    transform: translateY(-1px);
}

.circle-empty-cta i {
    font-size: 0.8rem;
}

/* ─── Loading State ─────────────────────────────────────────────────────────── */
.circle-loading {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-dim, #a0a0a0);
    font-size: 0.88rem;
}

.circle-loading i {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ─── Skeleton Placeholders ─────────────────────────────────────────────────── */
.circle-skeleton-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.circle-skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite ease-in-out;
    flex-shrink: 0;
}

.circle-skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.circle-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite ease-in-out;
}

.circle-skeleton-line:first-child { width: 75%; }
.circle-skeleton-line:last-child { width: 45%; }

.circle-skeleton-poster {
    width: 42px;
    height: 62px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite ease-in-out;
    flex-shrink: 0;
}

/* Reuse the shimmer from style.css */

/* ─── Divider ───────────────────────────────────────────────────────────────── */
.circle-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.04);
    margin: 8px 0;
}

/* ─── Fade-in animation ─────────────────────────────────────────────────────── */
.circle-fade-in {
    animation: circleFadeIn 0.35s ease both;
}

@keyframes circleFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Back row (above title, for consistency) ───────────────────────────────── */
.circle-back-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.circle-back-row a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim, #a0a0a0);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
    min-height: 44px;
    padding: 0 4px;
}

.circle-back-row a:hover {
    color: var(--text-main, #fff);
}

/* ─── Mobile Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .circle-page {
        padding: 82px 16px 90px;
    }

    .circle-title {
        font-size: 1.55rem;
    }

    .circle-activity-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .circle-activity-avatar {
        width: 40px;
        height: 40px;
    }

    .circle-activity-poster {
        width: 36px;
        height: 54px;
    }

    .circle-activity-text {
        font-size: 0.84rem;
    }

    .circle-following-avatar {
        width: 48px;
        height: 48px;
    }

    .circle-suggest-avatar {
        width: 42px;
        height: 42px;
    }

    .circle-search-input {
        font-size: 1rem; /* Prevent zoom on iOS */
    }
}

@media (min-width: 768px) {
    .circle-page {
        padding: 110px 20px 80px;
    }

    .circle-activity-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    }
}
