:root {
    --bg-base: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-glass: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-1: #8b5cf6;
    --accent-2: #ec4899;
    --accent-glow: rgba(139, 92, 246, 0.5);
    --danger: #ef4444;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-radius: 1rem;
    --font-stack: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-stack);
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: var(--bg-surface-glass);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo ion-icon {
    color: var(--accent-1);
    -webkit-text-fill-color: initial;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Container & Header */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.header-hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-out forwards;
}

.header-hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Filter Chips */
.filter-form {
    margin-bottom: 2rem;
    text-align: center;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
.chip {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.chip:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}
.chip.active {
    background: var(--accent-1);
    color: white;
    border-color: var(--accent-1);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

/* Feed & Cards */
.feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideUp 0.6s ease-out both;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.3);
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--accent-1), var(--accent-2));
    opacity: 0;
    transition: opacity 0.3s;
}
.post-card:hover::before {
    opacity: 1;
}

/* Elements inside card */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.post-type {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-nsfw {
    background: var(--danger);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
}

.post-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Media Content */
.post-media {
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    background: #000; /* For videos/images that don't fill */
}

.post-media img, .post-media video {
    width: 100%;
    height: auto;
    max-height: 1200px; /* Increased to avoid cutoff, while still preventing extreme heights */
    object-fit: contain; /* Contain rather than cover to prevent cutoff */
    display: block;
}

.movie-poster {
    max-height: 600px !important;
    object-fit: contain !important;
}

/* Movie Cast Strip */
.movie-cast-strip {
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border-color);
}
.movie-cast-strip .cast-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-1);
    margin-bottom: 0.6rem;
}
.movie-cast-strip .cast-faces {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}
.movie-cast-strip .cast-faces::-webkit-scrollbar {
    height: 0;
}
.movie-cast-strip .cast-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    width: 52px;
    text-decoration: none;
    color: inherit;
}
.movie-cast-strip .cast-face img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: border-color 0.2s ease, transform 0.2s ease;
    background: var(--bg-base);
}
.movie-cast-strip .cast-face img:hover {
    border-color: var(--accent-1);
    transform: scale(1.1);
}
.movie-cast-strip .cast-face-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(236,72,153,0.2));
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-1);
}
.movie-cast-strip .cast-name {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
    max-width: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blurred img, .blurred video {
    filter: blur(25px);
    transition: filter 0.5s ease;
}

/* NSFW Overlay */
.nsfw-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    border-radius: var(--card-radius);
    color: white;
}

.nsfw-overlay ion-icon {
    font-size: 3rem;
    color: var(--danger);
    margin-bottom: 1rem;
}

.nsfw-overlay h3 {
    margin-bottom: 0.5rem;
}

.nsfw-overlay p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.nsfw-overlay button {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.nsfw-overlay button:hover {
    background: var(--danger);
    color: white;
}

/* Text Content */
.post-content {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.quote {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-primary);
    border-left: 4px solid var(--accent-1);
    padding-left: 1rem;
    margin: 1rem 0;
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-1);
    text-decoration: none;
    font-weight: 500;
}

.external-link:hover {
    text-decoration: underline;
}

/* Actions */
.post-actions {
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    font-family: inherit;
}

.action-btn:hover {
    color: var(--accent-1);
}

.action-btn.active {
    color: var(--accent-2);
}

.action-btn.active ion-icon {
    animation: pop 0.3s ease;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-surface);
    border-radius: var(--card-radius);
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
}

.empty-state ion-icon {
    font-size: 4rem;
    color: var(--accent-1);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Share Popup */
.share-wrapper {
    position: relative;
}

.share-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 0.75rem);
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.5rem;
    min-width: 200px;
    z-index: 50;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: popIn 0.2s ease-out;
}

.share-popup.open {
    display: flex;
    flex-direction: column;
}

.share-popup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 1.5rem;
    width: 12px;
    height: 12px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.share-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    text-align: left;
}

.share-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.share-link ion-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.share-fb:hover { color: #1877F2; }
.share-x:hover { color: #f5f5f5; }
.share-wa:hover { color: #25D366; }
.share-tg:hover { color: #26A5E4; }
.share-rd:hover { color: #FF4500; }
.share-mail:hover { color: #EA4335; }
.share-copy:hover { color: var(--accent-1); }

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Adding stagger effect to child cards */
.feed > article:nth-child(1) { animation-delay: 0.1s; }
.feed > article:nth-child(2) { animation-delay: 0.2s; }
.feed > article:nth-child(3) { animation-delay: 0.3s; }
.feed > article:nth-child(4) { animation-delay: 0.4s; }
.feed > article:nth-child(5) { animation-delay: 0.5s; }
