:root {
    --primary-color: #ec4899; /* Pink premium */
    --secondary-color: #8b5cf6; /* Purple gradient */
    --bg-dark: #000000;
    --text-light: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Outfit', -apple-system, sans-serif;
    overflow: hidden; /* Prevent body scroll, let feed-container scroll */
    overscroll-behavior-y: none;
}

/* Typography Utilities */
.text-premium {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Base Utilities */
.d-flex { display: flex !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.align-items-center { align-items: center !important; }
.flex-column { flex-direction: column !important; }
.text-center { text-align: center !important; }
.text-danger { color: #ef4444 !important; }
.fw-bold { font-weight: 700 !important; }
.small { font-size: 0.825rem !important; }
.opacity-50 { opacity: 0.5 !important; }
.w-100 { width: 100% !important; }
.m-0 { margin: 0 !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.p-3 { padding: 1rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.rounded-3 { border-radius: 0.75rem !important; }
.rounded-pill { border-radius: 50rem !important; }
.border-bottom { border-bottom: 1px solid rgba(255,255,255,0.1) !important; }

/* APP VIEWS */
.app-view {
    display: none;
    height: calc(100vh - 60px);
    width: 100vw;
    overflow-y: auto;
    background-color: var(--bg-dark);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

#view-feed {
    height: 100vh; /* Feed is full screen with overlays */
}

/* VIEW HEADERS */
.view-header {
    padding: 2rem 1.5rem 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.view-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
}

.view-header i {
    font-size: 1.5rem;
    opacity: 0.6;
}

/* TOP HEADER */
.top-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem 1rem 1rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}

.logo-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.logo-title span {
    color: var(--primary-color);
}

.top-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-tab {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.6;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.nav-tab.active {
    opacity: 1;
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20%;
    width: 60%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.icon-btn i {
    font-size: 1.3rem;
}

#sentinel {
    height: 0;
    width: 0;
    overflow: hidden;
}

/* FEED CONTAINER (The Magic Wrapper) */
.feed-container {
    height: 100vh;
    width: 100vw;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    /* Hide scrollbar for Chrome, Safari and Opera */
}
.feed-container::-webkit-scrollbar {
    display: none;
}
.feed-container {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* INDIVIDUAL VIDEO CARD */
.video-card {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    position: relative;
    background-color: #111;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
}

/* OVERLAYS */
.overlay-gradient {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 40%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

/* SIDE INTERACTIONS */
.side-interactions {
    position: absolute;
    right: 12px;
    bottom: 110px; /* Elevated to clear bottom navbar + margin */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    z-index: 10;
}

.interaction-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.interaction-btn i {
    font-size: 2rem;
    filter: drop-shadow(1px 2px 4px rgba(0,0,0,0.5));
    transition: transform 0.2s ease;
}

.interaction-btn span {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.interaction-btn:active i {
    transform: scale(0.85);
}

.icon-heart.liked {
    color: var(--primary-color);
}

.btn-like {
    position: relative;
    margin-bottom: 0.5rem;
}

.creator-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.follow-badge {
    position: absolute;
    bottom: -8px;
    font-size: 1.2rem !important;
    color: var(--primary-color);
    background: white;
    border-radius: 50%;
    padding: 0;
    line-height: 0;
}

/* The Premium Tip Button */
.btn-tip i {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.2rem;
}
.tip-text {
    color: var(--primary-color);
}

/* BOTTOM INFO */
.bottom-info {
    position: absolute;
    bottom: 100px; /* Elevated to clear bottom navbar + margin */
    left: 15px;
    width: calc(100% - 80px); /* Leave room for side interactions */
    z-index: 10;
}

.creator-username {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.video-caption {
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.tags {
    font-weight: 600;
}

.music-ticker {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    max-width: 60%;
}
.music-ticker i {
    animation: spin 3s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* BOTTOM NAVIGATION */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 60px;
    background-color: var(--bg-dark);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    gap: 3px;
    transition: color 0.3s ease;
}

.nav-item.active {
    color: white;
}

.nav-item i {
    font-size: 1.4rem;
}

.upload-btn-container {
    position: relative;
    top: -5px;
}

.upload-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    width: 45px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.upload-btn i {
    font-size: 1.8rem;
    font-weight: 800;
}

/* CHAT LIST */
.chat-list {
    padding: 1rem 0;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem 1.5rem;
    transition: background 0.2s ease;
    cursor: pointer;
}

.chat-item:active {
    background-color: rgba(255,255,255,0.05);
}

.avatar-container {
    position: relative;
}

.avatar-container img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-container.online::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border: 2px solid var(--bg-dark);
    border-radius: 50%;
}

.chat-info {
    flex: 1;
}

.chat-info .creator-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.chat-info .last-msg {
    font-size: 0.85rem;
    opacity: 0.6;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.chat-meta .time {
    font-size: 0.7rem;
    opacity: 0.4;
}

.badge-msg {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

/* CHAT WINDOW */
.chat-window {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    background-color: var(--bg-dark);
    z-index: 500;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.chat-window.active {
    transform: translateX(0);
    visibility: visible;
}

.chat-header {
    padding: 1.2rem 1rem;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-header-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.chat-header h4 {
    flex: 1;
    margin: 0;
    font-size: 1rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.msg-bubble {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.msg-received {
    background-color: #262626;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.msg-sent {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* PPV Locked Msg */
.ppv-message {
    background-color: #1a1a1a;
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 15px;
    align-self: flex-start;
    width: 240px;
}

.ppv-preview {
    width: 100%;
    height: 300px;
    background-color: #333;
    border-radius: 10px;
    margin-bottom: 12px;
    filter: blur(15px);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ppv-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.6rem;
    width: 100%;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.chat-input-area {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #121212;
    padding-bottom: env(safe-area-inset-bottom, 1rem);
}

.chat-input-area input {
    flex: 1;
    background-color: #262626;
    border: none;
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    outline: none;
}

/* PROFILE VIEW */
.balance-card {
    background: linear-gradient(135deg, #1e1e1e, #111);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 25px;
    text-align: center;
    margin: 1.5rem;
}

.balance-card p {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-bottom: 5px;
}

.coins-label {
    color: var(--primary-color);
    font-size: 1rem;
}

.p-link {
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-weight: 500;
    transition: background 0.2s ease;
    cursor: pointer;
}

.p-link:active, .p-link:hover {
    background-color: rgba(255,255,255,0.05);
}

.p-link i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* CREATOR PROFILE DETAIL */
.creator-profile-header {
    position: relative;
    padding-bottom: 1.5rem;
    background-color: var(--bg-dark);
}

.profile-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    opacity: 0.5;
}

.header-overlay {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 10;
}

.header-overlay i {
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    cursor: pointer;
}

.creator-profile-info {
    padding: 0 1.5rem;
    margin-top: -60px;
    position: relative;
    text-align: center;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--bg-dark);
    object-fit: cover;
    margin-bottom: 10px;
}

.creator-profile-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.creator-bio {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 5px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item strong {
    font-size: 1.1rem;
    font-weight: 700;
}

.stat-item span {
    font-size: 0.75rem;
    opacity: 0.5;
    text-transform: uppercase;
}

.creator-content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
    margin-top: 1rem;
}

.grid-item {
    aspect-ratio: 9/16;
    background-color: #333;
    overflow: hidden;
    position: relative;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-item i {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1rem;
    color: white;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.btn-premium-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    transition: transform 0.2s ease;
}

/* EXPLORE SCREEN */
.search-bar-container {
    background-color: #262626;
    border-radius: 25px;
    padding: 0.6rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.search-bar-container input {
    background: none;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-size: 0.95rem;
}

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cat-pill {
    background-color: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.bg-dark-soft {
    background-color: #1a1a1a;
}

.fw-bold { font-weight: 700 !important; }

/* SHARED COMPONENTS */
.btn-nav {
    position: relative;
    overflow: hidden;
}

.btn-nav.active i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.btn-nav i {
    transition: all 0.2s ease;
}

/* AUTH MODAL */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-modal-overlay.active {
    display: flex;
}

.auth-modal-container {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2rem;
    border-radius: 2rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.2rem;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s;
}

.auth-modal-close:hover {
    opacity: 1;
}

.auth-form input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.2rem;
    border-radius: 1rem;
    color: white;
    outline: none;
    transition: border-color 0.2s;
}

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

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    opacity: 0.3;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid white;
}

.divider span {
    padding: 0 10px;
    font-size: 0.8rem;
}

.google-auth-btn {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}


/* GUEST ACCESS SCREEN IMPROVEMENTS */
.guest-access-screen {
    position: relative;
    height: 100%;
    width: 100%;
    background-image: url('../img/profile-guest-bg.png');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.guest-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.95));
    z-index: 1;
}

.guest-content {
    position: relative;
    z-index: 2;
    color: white;
}

.guest-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 0 15px rgba(236, 72, 153, 0.4));
}

.btn-open-auth-guest {
    max-width: 280px;
    margin: 0 auto 2rem auto;
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    display: block;
    width: 100%;
}

.btn-glow {
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.3);
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.6);
}

/* TIMELINE VIEW (TikTok Style) */
#view-perfil-timeline {
    height: 100vh;
    z-index: 600; /* Above navbar if needed, but we'll handle routing */
}

.timeline-header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
    justify-content: space-between;
    padding: env(safe-area-inset-top, 1rem) 1.5rem 1rem 1.5rem;
}

.timeline-container {
    height: 100vh;
    width: 100vw;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    padding-bottom: 0;
}

.timeline-container .video-card {
    height: 100vh;
    scroll-snap-align: start;
}


