@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0f0f13;
    --bg-card: rgba(25, 25, 30, 0.6);
    --bg-card-hover: rgba(35, 35, 45, 0.8);
    --text-main: #fcfcfc;
    --text-muted: #a0a0b0;
    --accent-primary: #ff2a5f;
    --accent-secondary: #9c27b0;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 42, 95, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 42, 95, 0.5);
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
}

/* Typography */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 700; line-height: 1.2; }
p { color: var(--text-muted); line-height: 1.6; }

.gradient-text {
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 8px; color: var(--text-muted);
}
.form-control {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
}
.form-control:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 42, 95, 0.2);
}

select.form-control {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23a0a0b0" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position-x: 95%;
    background-position-y: 50%;
}

/* Layout */
.container {
    width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px;
}
.app-layout {
    display: none; /* hidden until logged in */
    flex: 1;
}

/* Navbar */
.navbar {
    padding: 20px 0;
    position: sticky; top: 0; z-index: 2000;
    background: rgba(15, 15, 19, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}
.nav-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.8rem; font-weight: 800; text-decoration: none; color: white; display:flex; align-items:center; gap:10px;}
.nav-links { display: flex; gap: 20px; align-items: center;}
.nav-item { color: var(--text-main); text-decoration: none; font-weight: 500; transition: var(--transition); cursor:pointer; }
.nav-item:hover { color: var(--accent-primary); }

/* Grid System */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* Avatar */
.avatar {
    width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-primary);
}

/* Notifications */
.toast {
    position: fixed; bottom: 20px; right: 20px;
    padding: 16px 24px; border-radius: var(--radius-md);
    background: var(--bg-card); color: white; border-left: 4px solid var(--accent-primary);
    z-index: 9999; backdrop-filter: var(--glass-blur);
    transform: translateY(100px); opacity: 0; transition: var(--transition);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-left-color: #ff3333; }
.toast.success { border-left-color: #00e676; }

/* Views container */
.view { display: none; animation: fadeIn 0.4s ease; padding-top: 40px; padding-bottom: 80px;}
.view.active { display: block; }
@keyframes fadeIn { from {opacity: 0; transform: translateY(10px);} to {opacity: 1; transform: translateY(0);} }

/* Loader */
.loader-container { display:flex; justify-content:center; padding: 50px 0; }
.loader { width: 40px; height: 40px; border: 3px solid var(--border-color); border-top-color: var(--accent-primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to {transform: rotate(360deg);} }

/* Creator Cards */
.creator-card { padding: 20px; text-align: center; }
.creator-card .avatar { width: 80px; height: 80px; margin: 0 auto 15px auto; }
.creator-card h3 { margin-bottom: 5px; }
.creator-card .price { font-weight: bold; color: var(--accent-primary); margin: 15px 0;}

/* Feed Post */
.post { padding: 0; overflow: hidden; margin-bottom: 30px; }
.post-header { padding: 20px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--border-color); }
.post-media { width: 100%; max-height: 600px; object-fit: contain; background: #000; border-bottom: 1px solid var(--border-color);}
.post-body { padding: 20px; }

/* Wallet UI */
.wallet-balance { font-size: 3rem; font-weight: 800; background: var(--accent-gradient); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.token-pack { padding: 30px; text-align: center; cursor: pointer; transition: var(--transition); }
.token-pack:hover { transform: translateY(-5px); border-color: var(--accent-primary); }
.token-pack hr { border: none; height: 1px; background: var(--border-color); margin: 20px 0; }

/* Profile Redesign */
.profile-header { position: relative; padding-bottom: 20px; }
.profile-avatar-wrapper {
    position: relative; width: 140px; height: 140px; margin: 0 auto 20px;
    border-radius: 50%; overflow: hidden; border: 4px solid var(--accent-primary);
}
.avatar-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: var(--transition); cursor: pointer;
}
.profile-avatar-wrapper:hover .avatar-overlay { opacity: 1; }
.avatar-overlay span { font-size: 0.8rem; font-weight: bold; color: white; }

.tab-nav {
    display: flex; border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px; gap: 30px; justify-content: center;
}
.tab-link {
    padding: 12px 5px; color: var(--text-muted); cursor: pointer;
    font-weight: 600; border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.tab-link:hover { color: var(--text-main); }
.tab-link.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }

.profile-section { display: none; text-align: left; animation: fadeIn 0.3s ease; }
.profile-section.active { display: block; }

.subscriber-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.subscriber-table th { text-align: left; color: var(--text-muted); font-size: 0.8rem; padding: 12px 10px; border-bottom: 1px solid var(--border-color); }
.subscriber-table td { padding: 15px 10px; border-bottom: 1px solid rgba(255,255,255,0.03); vertical-align: middle; }
.subscriber-table tr:hover { background: rgba(255,255,255,0.02); }
.sub-user { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.sub-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.sub-price { color: var(--accent-primary); font-weight: bold; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; transition: var(--transition); }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content { max-width: 500px; width: 90%; background: var(--bg-dark); border: 1px solid var(--border-color); padding: 30px; position: relative; }
.modal-close { position: absolute; top: 15px; right: 20px; cursor: pointer; font-size: 1.5rem; color: var(--text-muted); }

/* Premium Gift Modal Styles */
.preset-btn {
    flex: 1; min-width: 60px; height: 45px; font-weight: bold; border-radius: 12px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s ease;
}
.preset-btn:hover {
    background: var(--accent-gradient); color: white; border-color: transparent;
    transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 42, 95, 0.3);
}
.preset-btn:active { transform: scale(0.95); }

#gift-amount::-webkit-inner-spin-button, 
#gift-amount::-webkit-outer-spin-button { 
  -webkit-appearance: none; margin: 0; 
}
#gift-amount { 
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Landing View specific */
.hero { display: flex; align-items: center; justify-content: space-between; min-height: 80vh; gap: 50px; }
.hero-text h1 { font-size: 4rem; margin-bottom: 20px; }
.hero-text p { font-size: 1.2rem; margin-bottom: 30px; max-width: 500px;}
.hero-image { flex: 1; display:flex; justify-content:center; }
.hero-image img { max-width: 100%; border-radius: var(--radius-lg); box-shadow: 0 20px 50px rgba(255, 42, 95, 0.2); }

@media(max-width: 768px) {
    .hero { flex-direction: column; text-align: center; padding-top:40px; }
    .hero-text h1 { font-size: 2.5rem; }
    .hero-text p { margin: 0 auto 30px auto; }
    .nav-content { position: relative; flex-direction: row; justify-content: center; align-items: center; width: 100%; }
    .mobile-menu-btn { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); }
}

/* ========================
   LANGUAGE SWITCHER
======================== */
#lang-switcher { display: flex; gap: 6px; }
.lang-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}
.lang-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}
.lang-btn:hover { border-color: var(--accent-primary); color: var(--text-main); }

/* ========================
   POST CREATOR PANEL
======================== */
.modal-content.creator-modal {
    max-width: 680px;
    width: 95%;
    border-radius: var(--radius-lg);
}

.post-type-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    background: rgba(0,0,0,0.3);
    padding: 6px;
    border-radius: var(--radius-md);
}
.tab-btn {
    flex: 1;
    padding: 10px 5px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.tab-btn.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(255,42,95,0.3);
}
.tab-btn:hover:not(.active) { color: var(--text-main); background: rgba(255,255,255,0.05); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* Drag & Drop Zone */
.drag-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}
.drag-drop-zone:hover, .drag-drop-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(255,42,95,0.05);
}
.drag-drop-zone input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.drag-drop-icon { font-size: 3rem; margin-bottom: 10px; display: block; }
.drag-drop-zone p { font-size: 0.9rem; }
.drag-drop-zone small { color: var(--text-muted); font-size: 0.8rem; }

/* Media Preview */
.media-preview-container { margin-bottom: 20px; display: none; }
.media-preview-container.visible { display: block; }
.media-preview-container img,
.media-preview-container video {
    width: 100%; max-height: 300px; object-fit: contain;
    border-radius: var(--radius-md); border: 1px solid var(--border-color);
    background: #000;
}
.preview-remove {
    display: block; margin-top: 8px; color: #ff4444; cursor: pointer;
    font-size: 0.85rem; text-align: center; font-weight: 600;
}

/* Gradient Text Post */
.gradient-text-editor {
    display: flex; flex-direction: column; gap: 16px;
}
.gradient-preview {
    width: 100%; min-height: 200px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    padding: 30px; font-size: 1.5rem; font-weight: 700; text-align: center;
    color: white; text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    word-break: break-word; cursor: text;
    transition: background 0.4s ease;
    border: 2px solid transparent;
}
.gradient-preview[contenteditable="true"]:focus { outline: none; border-color: rgba(255,255,255,0.2); }
.gradient-preview:empty::before {
    content: attr(data-placeholder);
    color: rgba(255,255,255,0.5);
    font-size: 1.1rem;
}

.gradient-picker {
    display: flex; flex-wrap: wrap; gap: 10px;
}
.gradient-option {
    width: 44px; height: 44px; border-radius: 50%;
    cursor: pointer; border: 3px solid transparent;
    transition: var(--transition); flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.gradient-option:hover, .gradient-option.selected {
    transform: scale(1.2);
    border-color: white;
}

/* Post feed: text post card */
.post-text-card {
    min-height: 280px;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 30px; font-size: 1.4rem; font-weight: 700;
    color: white; text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    text-align: center; word-break: break-word;
    border-bottom: 1px solid var(--border-color);
}

/* Post feed: video */
.post-video {
    width: 100%; max-height: 600px;
    background: #000;
    border-bottom: 1px solid var(--border-color);
    display: block;
}

/* Post feed: image */
.post-img {
    width: 100%;
    max-height: 550px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-top: 15px;
    border: 1px solid rgba(255,42,95,0.1);
    display: block;
}

/* ========================
   CHAT SYSTEM
======================== */
#view-chat { display: none; padding:0; overflow:hidden; }
#view-chat.active { display: flex; gap: 0; min-height: 500px; height: 75vh; border-radius: var(--radius-lg); }

.chat-sidebar {
    width: 320px; flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    overflow: hidden;
}
.chat-sidebar-header {
    padding: 20px; font-size: 1.1rem; font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}
.chat-conversations { flex: 1; overflow-y: auto; }
.chat-conv-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; cursor: pointer; transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}
.chat-conv-item:hover, .chat-conv-item.active { background: rgba(255,42,95,0.08); }
.chat-conv-info { flex: 1; min-width: 0; }
.chat-conv-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.chat-conv-last { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-unread-badge {
    background: var(--accent-gradient); color: white;
    font-size: 0.7rem; font-weight: 700;
    padding: 2px 7px; border-radius: 20px; flex-shrink: 0;
}

/* Chat panel right */
.chat-main {
    flex: 1; display: flex; flex-direction: column;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    overflow: hidden;
}
.chat-main-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 12px;
    font-weight: 700;
}
.chat-messages-area {
    flex: 1; overflow-y: auto; padding: 20px;
    display: flex; flex-direction: column; gap: 12px;
}
.chat-messages-area::-webkit-scrollbar { width: 4px; }
.chat-messages-area::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.chat-placeholder {
    flex: 1; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); flex-direction: column; gap: 10px; font-size: 1.1rem;
}

.msg-bubble {
    max-width: 70%; padding: 10px 16px;
    border-radius: 18px; font-size: 0.9rem; line-height: 1.5;
    animation: fadeIn 0.2s ease; word-break: break-word;
}
.msg-bubble.sent {
    background: var(--accent-gradient);
    color: white; align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.msg-bubble.received {
    background: rgba(255,255,255,0.07);
    color: var(--text-main); align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.msg-time { font-size: 0.7rem; opacity: 0.65; margin-top: 4px; display: block; }

.chat-img { 
    max-width: 100%; border-radius: 12px; cursor: pointer; transition: transform 0.2s; 
    margin-bottom: 5px; display: block;
}
.chat-img:hover { transform: scale(1.02); }
.chat-video { 
    max-width: 100%; border-radius: 12px; margin-bottom: 5px; display: block;
}

.token-gift-msg {
    text-align: center; padding: 10px; background: rgba(255,255,255,0.05); 
    border-radius: 12px; border: 1px solid rgba(255,215,0,0.3);
    margin-bottom: 8px;
}
.msg-bubble.token { min-width: 140px; }

.chat-input-bar {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex; gap: 10px; align-items: center;
}
.chat-input {
    flex: 1; padding: 12px 16px;
    background: rgba(0,0,0,0.2); border: 1px solid var(--border-color);
    border-radius: 24px; color: var(--text-main); font-size: 0.95rem; outline: none;
    transition: var(--transition);
}
.chat-input:focus { border-color: var(--accent-primary); }
.chat-tool-btn {
    background: transparent; border: none; font-size: 1.4rem; cursor: pointer;
    transition: var(--transition); color: var(--text-muted); padding: 0 5px;
}
.chat-tool-btn:hover { color: var(--accent-primary); transform: translateY(-2px); }
.chat-send-btn {
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: var(--accent-gradient); color: white; cursor: pointer;
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    transition: var(--transition); flex-shrink: 0;
}
.chat-send-btn:hover { transform: scale(1.1); box-shadow: 0 4px 15px rgba(255,42,95,0.4); }

/* Chat empty state */
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: var(--text-muted); text-align: center; padding: 40px; }
.chat-empty-icon { font-size: 3rem; }

/* Responsive Chat */
@media(max-width: 768px) {
    #view-chat.active { 
        flex-direction: column; 
        position: fixed;
        top: 60px;
        bottom: calc(65px + env(safe-area-inset-bottom, 15px));
        left: 0;
        width: 100%;
        z-index: 1000;
        border-radius: 0;
        height: auto;
    }
    .chat-sidebar { 
        width: 100%; 
        height: 100%;
        border-right: none; 
        display: flex;
    }
    .chat-main { 
        width: 100%;
        height: 100%;
        display: none; 
        position: absolute;
        top: 0;
        left: 0;
        z-index: 10;
    }
    #view-chat.show-chat .chat-sidebar { display: none; }
    #view-chat.show-chat .chat-main { display: flex; }

    .chat-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
        cursor: pointer;
        font-size: 1.2rem;
        color: var(--accent-primary);
    }
    .chat-input-bar {
        padding: 15px 15px calc(15px + env(safe-area-inset-bottom, 0px));
        background: rgba(15,15,20,0.98);
    }
}

.chat-back-btn { display: none; }

/* Scrollbar custom */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ========================
   COMMENTS
======================== */
.post-actions {
    padding: 10px 20px;
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}
.post-action-btn {
    background: transparent; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 0.85rem; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.post-action-btn:hover { color: var(--accent-primary); background: rgba(255,42,95,0.06); }
.post-action-btn.active { color: var(--accent-primary); }

.comments-section {
    border-top: 1px solid var(--border-color);
    padding: 0 20px 16px;
    display: none;
}
.comments-section.open { display: block; animation: fadeIn 0.3s ease; }

.comment-item {
    display: flex; gap: 12px; padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.comment-item:last-child { border-bottom: none; }
.comment-content { flex: 1; }
.comment-username { font-weight: 600; font-size: 0.85rem; margin-bottom: 3px; color: var(--text-main); }
.comment-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.comment-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; opacity: 0.7; }

.comment-composer {
    display: flex; gap: 10px; align-items: center;
    padding: 12px 0 0;
}
.comment-input {
    flex: 1; padding: 10px 14px;
    background: rgba(0,0,0,0.2); border: 1px solid var(--border-color);
    border-radius: 20px; color: var(--text-main);
    font-size: 0.9rem; outline: none; transition: var(--transition);
}
.comment-input:focus { border-color: var(--accent-primary); }
.comment-submit {
    padding: 9px 18px; border-radius: 20px; border: none;
    background: var(--accent-gradient); color: white;
    font-weight: 600; font-size: 0.85rem;
    cursor: pointer; transition: var(--transition);
    white-space: nowrap; flex-shrink: 0;
}
.comment-submit:hover { filter: brightness(1.1); transform: translateY(-1px); }
.comment-none { color: var(--text-muted); font-size: 0.85rem; padding: 10px 0; text-align: center; }

/* Comment Replies */
.comment-reply-btn {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; transition: var(--transition);
}
.comment-reply-btn:hover { color: var(--accent-primary); }
.comment-reply-btn.active { color: var(--accent-primary); background: rgba(255,42,95,0.1); padding: 2px 6px; border-radius: 10px; }
.comment-replies {
    margin-top: 10px; margin-left: 10px; padding-left: 15px;
    border-left: 2px solid rgba(255,42,95,0.2);
}
.comment-reply-badge {
    color: var(--accent-primary); font-weight: 600; font-size: 0.85rem;
    margin-right: 4px;
}
.replying-to-badge {
    display: none; background: rgba(255,42,95,0.15); color: var(--accent-primary);
    padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600;
    margin-bottom: 8px; width: fit-content; align-items: center; gap: 6px;
}
.replying-to-badge.active { display: flex; }
.replying-cancel { cursor: pointer; color: white; font-size: 0.9rem; margin-left: 4px; }

/* Reactions Bubble (Facebook style) */
.reaction-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.reaction-bubble {
    position: absolute;
    bottom: 120%; /* Position above the button */
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.8);
    background: rgba(30, 30, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    border-radius: 30px;
    padding: 6px 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
}
.reaction-wrapper:hover .reaction-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}
.reaction-bubble span {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    user-select: none;
    line-height: 1;
}
.reaction-bubble span:hover {
    transform: scale(1.3) translateY(-4px);
}
/* Adjustments for nested comments bubble */
.reaction-bubble.comment-bubble {
    left: 0%;
    transform: translateX(0) translateY(10px) scale(0.8);
}
.reaction-wrapper:hover .reaction-bubble.comment-bubble {
    transform: translateX(0) translateY(0) scale(1);
}
.reaction-wrapper .react-icon { font-size: 1.1em; margin-right: 2px; }
.reaction-wrapper .react-count { font-size: 0.9em; font-weight: 600; }

/* Force close via JS class */
.reaction-wrapper.hide-bubble .reaction-bubble {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateX(-50%) translateY(10px) scale(0.8) !important;
}
.reaction-wrapper.hide-bubble .reaction-bubble.comment-bubble {
    transform: translateX(0) translateY(10px) scale(0.8) !important;
}

/* Base classes */
/* Base classes - Hidden on Desktop */
.mobile-menu-btn { display: none; }
.mobile-bottom-nav { display: none; }
.mobile-side-menu { display: none; }

/* ========================
   MOBILE BOTTOM NAVIGATION
======================== */
@media (max-width: 768px) {
    /* Hide top navbar elements except logo & unauth menu */
    .navbar {
        position: fixed;
        top: 0;
        width: 100%;
        padding: 15px 0;
        background: rgba(15, 15, 19, 0.95);
        border-bottom: 1px solid var(--border-color);
        z-index: 2000;
    }
    
    /* Layout main container to avoid being hidden behind bottom bar */
    body { padding-bottom: 80px; padding-top: 60px; }
    
    /* Styles for logged-in mobile nav */
    #auth-nav {
        display: none !important; /* Hide the regular auth-nav completely from header */
    }

    /* Mobile hamburger toggle */
    .mobile-menu-btn.active {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    /* Mobile Side Menu (Offcanvas) */
    .mobile-side-menu {
        display: flex;
        position: fixed;
        top: 70px;
        right: -100%;
        width: 250px;
        height: calc(100vh - 70px);
        background: rgba(20, 20, 25, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 2000;
        transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        padding: 20px;
        display: flex;
        flex-direction: column;
    }
    .mobile-side-menu.open {
        right: 0;
    }
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        padding-bottom: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .mobile-menu-header h3 { margin: 0; font-size: 1.2rem; }
    .close-menu { font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
    .close-menu:hover { color: var(--text-main); }
    .mobile-menu-content {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    .mobile-menu-content .nav-item {
        font-size: 1.1rem;
        padding: 10px 0;
    }

    /* Create the new mobile tab bar using a dedicated container */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0; left: 0; width: 100%; z-index: 2000;
        background: rgba(10, 10, 15, 0.85);
        backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        display: none; /* hidden by default, shown by JS when logged in */
        justify-content: space-around;
        align-items: center;
        padding: 10px 0;
        z-index: 2000;
        padding-bottom: env(safe-area-inset-bottom, 15px); /* iOS safe area */
    }

    .mobile-bottom-nav.active {
        display: flex;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 500;
        gap: 4px;
        flex: 1;
        transition: var(--transition);
        background: transparent;
        border: none;
        cursor: pointer;
    }

    .mobile-nav-item i {
        font-size: 1.4rem;
        font-style: normal;
        margin-bottom: 2px;
    }

    .mobile-nav-item:hover, .mobile-nav-item.active {
        color: var(--accent-primary);
    }
    
    /* The Create Post FAB button in the middle */
    .mobile-nav-fab {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--accent-gradient);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.5rem;
        box-shadow: 0 4px 15px rgba(255, 42, 95, 0.4);
        transform: translateY(-15px);
        margin: 0 10px;
        border: 4px solid var(--bg-dark);
        transition: var(--transition);
    }
    
    .mobile-nav-fab:hover {
        transform: translateY(-18px) scale(1.05);
    }
}

/* ========================
   CUSTOM VIDEO PLAYER
======================== */
.custom-video-container {
    position: relative;
    width: 100%;
    margin-top: 15px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,42,95,0.1);
    background: #000;
    overflow: hidden;
}

.video-center-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(255, 42, 95, 0.8);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255,42,95,0.4);
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.2s;
    z-index: 10;
}
.video-center-play:hover {
    transform: translate(-50%, -50%) scale(1.1);
}
.video-center-play.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    border-radius: var(--radius-md);
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20;
}

.custom-video-container:hover .video-controls,
.custom-video-container.paused .video-controls {
    opacity: 1;
}

.vc-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: color 0.2s, transform 0.2s;
}
.vc-btn:hover {
    color: var(--accent-primary);
    transform: scale(1.1);
}

.vc-progress-container {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.vc-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 3px;
    pointer-events: none;
}

.vc-time {
    font-size: 0.8rem;
    color: white;
    font-variant-numeric: tabular-nums;
    font-family: monospace;
    min-width: 80px;
    text-align: center;
}

/* ========================
   CONTENT PROTECTION
======================== */
.protected-media-container {
    position: relative;
    display: block;
    width: 100%;
    user-select: none;
    -webkit-user-drag: none;
}

.media-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: transparent;
    cursor: default;
}

.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 900;
    color: rgba(255, 255, 255, 0.07);
    white-space: nowrap;
    pointer-events: none;
    z-index: 4;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 15px;
}

.watermark-corner {
    top: auto;
    left: auto;
    bottom: 15px;
    right: 15px;
    transform: none;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.protected-media-container img, 
.protected-media-container video {
    pointer-events: none; /* Only the shield receives events */
}

/* ========================
   LIGHTBOX
======================== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    object-fit: contain;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: var(--accent-primary);
    transform: rotate(90deg);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

