/* ========================================
   FansJoyo Clone - Main Stylesheet
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #F97316;
    --primary-hover: #EA580C;
    --secondary-color: #1A1A2E;
    --accent-color: #F59E0B;
    --bg-primary: #0F0F1A;
    --bg-secondary: #161625;
    --card-bg: #1A1A2E;
    --text-primary: #FFFFFF;
    --text-muted: #8B8B9E;
    --border-color: #2A2A40;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input, textarea, select {
    font-family: inherit;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

/* Language Switch Button */
.lang-switch-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-switch-btn:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.lang-icon {
    font-size: 16px;
}

.lang-text {
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 8px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

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

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-white {
    border-color: white;
    color: white;
}

.btn-outline-white:hover {
    background: white;
    color: var(--primary-color);
}

.btn-white {
    background: white;
    color: var(--primary-color);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

/* ========================================
   Flash Messages
   ======================================== */
.flash-messages {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: 90%;
}

.alert {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.alert-info {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    padding: 140px 20px 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(255, 59, 157, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}

.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 59, 157, 0.15);
    border: 1px solid rgba(255, 59, 157, 0.3);
    border-radius: 50px;
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 24px;
}

.badge-icon {
    font-size: 16px;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
}

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

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    gap: 40px;
}

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

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.hero-visual {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    height: 400px;
    display: none;
}

@media (min-width: 1024px) {
    .hero-visual {
        display: block;
    }
}

.floating-card {
    position: absolute;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.card-1 {
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.card-2 {
    top: 40%;
    right: -10%;
    animation-delay: 2s;
}

.card-3 {
    top: 70%;
    right: 5%;
    animation-delay: 4s;
}

.card-icon {
    font-size: 24px;
}

/* ========================================
   Features Section
   ======================================== */
.features {
    padding: 80px 20px;
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px;
}

.section-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 59, 157, 0.15);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 36px;
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 18px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* ========================================
   Featured Creators
   ======================================== */
.featured-creators {
    padding: 80px 20px;
}

.creators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-cta {
    text-align: center;
    margin-top: 48px;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.cta-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 36px;
    margin-bottom: 16px;
}

.cta-content p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 20px 24px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-section p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.footer-section a {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 16px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 24px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
    }
}

/* ========================================
   Sidebar Navigation (Fanvue-style)
   ======================================== */
.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-x: visible;
    overflow-y: visible;
}

.sidebar-nav.expanded {
    width: 220px;
}

/* Sidebar Header (Avatar) */
.sidebar-header {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    height: 64px;
    box-sizing: border-box;
    position: relative;
}

/* When sidebar is expanded, align header items to the left */
.sidebar-nav.expanded .sidebar-header {
    justify-content: flex-start;
}

/* Toggle Button - positioned on right side */
.sidebar-toggle-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #ff2d55 !important;
    border: none;
    border-radius: 10px;
    color: #fff !important;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    z-index: 2000 !important;
    position: absolute;
    right: -20px;
    top: calc(100% - 20px);
}

.sidebar-toggle-btn:hover {
    background: #ff5c7c !important;
}

/* Arrow icon styles */
.toggle-arrow {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* When sidebar is expanded, rotate arrow to point left */
.sidebar-nav.expanded .toggle-arrow {
    transform: rotate(180deg);
}

.sidebar-toggle-btn svg {
    transition: transform 0.3s ease;
}

.sidebar-nav.expanded .sidebar-toggle-btn svg {
    transform: rotate(180deg);
}

.sidebar-avatar-wrapper {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff2d55;
    transition: all 0.3s ease;
}

.sidebar-avatar-wrapper:hover .sidebar-avatar {
    border-color: #ff5c7c;
    transform: scale(1.05);
}

/* Sidebar Items Container */
.sidebar-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 12px;
}

.sidebar-bottom {
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 80px;
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sidebar-nav.expanded .sidebar-bottom {
    width: 220px;
}

/* Sidebar Item */
.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    width: 80px;
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), padding 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    white-space: nowrap;
    overflow: visible;
}

/* When sidebar is expanded - icon stays centered, text appears on right */
.sidebar-nav.expanded .sidebar-item {
    justify-content: flex-start;
    width: 220px;
    padding-left: 20px;
    padding-right: 20px;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-item.active {
    background: rgba(255, 45, 85, 0.15);
    color: #ff2d55;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: #ff2d55;
    border-radius: 0 2px 2px 0;
}

.sidebar-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: margin 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin-right: 0;
}

.sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.15s ease 0.1s, width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), margin 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-nav.expanded .sidebar-text {
    opacity: 1;
    width: auto;
    margin-left: 12px;
    transition-delay: 0.05s;
}

/* Sidebar Badge */
.sidebar-badge {
    position: absolute;
    right: 20px;
    background: #ff2d55;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-nav.expanded .sidebar-badge {
    right: 24px;
}

/* Expanded User Info Panel */
.sidebar-expanded-info {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.sidebar-nav.expanded .sidebar-expanded-info {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.expanded-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expanded-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff2d55;
}

.expanded-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.expanded-user-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.expanded-user-type {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* Main Content Adjustments */
main, #main-content {
    padding-top: 0 !important;
    margin-left: 220px !important;
    width: calc(100% - 220px) !important;
    transition: margin-left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background-color: var(--bg-primary);
    box-sizing: border-box;
}

/* Hide old navbar and top bars */
.navbar, .top-nav, .search-container, .home-nav, .top-bar, .nav-bar, header.nav, div[class*="navbar"], div[class*="top-nav"], div[class*="search"] {
    display: none !important;
}

/* ========================================
   Main Content
   ======================================== */
main {
    padding: 24px;
    min-height: calc(100vh);
    background-color: var(--bg-primary);
    margin-left: 220px;
    width: calc(100% - 220px);
    box-sizing: border-box;
}

/* ========================================
   Chat / Conversation Styles
   ======================================== */
.conversation-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px);
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.back-btn {
    color: var(--text-muted);
    font-size: 24px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--primary-color);
}

.chat-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-name {
    font-size: 18px;
    font-weight: 600;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.message.sent {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: var(--card-bg);
    border-bottom-left-radius: 4px;
}

.message-content {
    margin-top: 8px;
    word-wrap: break-word;
}

.message-time {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.message-image,
.message-video {
    max-width: 250px;
    max-height: 250px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 8px;
}

.message-input-area {
    padding: 15px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.message-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.send-btn,
.subscribe-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    display: inline-block;
    min-width: 160px;
}

.send-btn:hover,
.subscribe-btn:hover {
    background: var(--primary-hover);
}

.ai-assist-btn,
.video-upload-btn,
.image-upload-btn,
.bundle-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.ai-assist-btn:hover,
.video-upload-btn:hover,
.image-upload-btn:hover,
.bundle-btn:hover {
    background: var(--border-color);
}

.subscribe-prompt {
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.subscribe-prompt p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.subscribe-prompt strong {
    color: var(--text-primary);
}

.no-messages {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Media Bundle Styles */
.media-bundle-unlocked {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.media-bundle-locked {
    position: relative;
    width: 200px;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.bundle-blur {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(20px);
    transform: scale(1.1);
}

.bundle-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    gap: 8px;
}

.bundle-lock-icon {
    font-size: 32px;
}

.bundle-count {
    font-size: 12px;
    opacity: 0.8;
}

.bundle-price {
    font-size: 18px;
    font-weight: 700;
}

.bundle-unlock-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 5px;
}

.bundle-payment-status {
    font-size: 12px;
    color: var(--warning-color);
    margin-top: 8px;
}

/* Bundle Modal */
.bundle-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.bundle-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}

.bundle-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bundle-modal-header h3 {
    font-size: 20px;
}

.bundle-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
}

.bundle-media-selection {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.bundle-media-selection:hover {
    border-color: var(--primary-color);
}

.bundle-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-muted);
}

.bundle-upload-icon {
    font-size: 40px;
}

.bundle-preview {
    margin: 20px 0;
}

.bundle-carousel {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.bundle-carousel img,
.bundle-carousel video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bundle-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.carousel-prev,
.carousel-next {
    background: var(--border-color);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
}

.carousel-dots .dot.active {
    background: var(--primary-color);
}

.bundle-remove-btn {
    width: 100%;
    padding: 10px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 8px;
    margin-top: 10px;
    cursor: pointer;
}

.bundle-settings {
    margin: 20px 0;
}

.bundle-price-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.active {
    background: var(--primary-color);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

.bundle-price-input {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

.price-prefix {
    font-size: 18px;
    color: var(--text-muted);
}

.bundle-price-input input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 16px;
}

.bundle-caption textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.bundle-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-outline:hover {
    background: var(--border-color);
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* AI Suggestions */
.ai-suggestions-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.ai-suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ai-icon {
    font-size: 20px;
}

.close-ai-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.ai-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-suggestion-item {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-suggestion-item:hover {
    background: var(--border-color);
}

.ai-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

/* Message Error */
.message-error {
    color: var(--error-color);
    font-size: 12px;
    margin-left: 10px;
}

/* Image/Video Modal */
.image-modal,
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.image-modal img,
.video-modal video {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.image-modal-close,
.video-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

/* ========================================
   固定展开的导航样式 - 游客模式
   ======================================== */

/* 固定展开的导航 */
.sidebar-nav {
    width: 220px !important;
}

/* 主导航按钮（文章/视频） */
.sidebar-main-nav {
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-main-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-main-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-main-item.active {
    background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.sidebar-main-item .sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-main-item .sidebar-text {
    font-size: 16px;
    font-weight: 600;
}

/* 子导航（分类） */
.sidebar-sub-nav {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 4px;
}

.sidebar-category-item {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sidebar-category-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-category-item.active {
    background: rgba(102, 126, 234, 0.2);
    color: #a5b4fc;
    border-left: 3px solid #667eea;
}

/* ========================================
   Mobile Responsive (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    /* Hide sidebar on mobile */
    .sidebar-nav {
        display: none !important;
    }

    /* Reset main content - full width on mobile */
    main,
    #main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 16px !important;
        padding-top: 72px !important;
        padding-bottom: 90px !important;
        padding-right: 16px !important;
        box-sizing: border-box;
    }

    /* Mobile top bar */
    .mobile-topbar {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: rgba(15, 15, 26, 0.98);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border-color);
        z-index: 1001;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        box-sizing: border-box;
    }

    .mobile-topbar-logo {
        font-size: 18px;
        font-weight: 700;
        color: var(--text-primary);
    }

    .mobile-hamburger {
        width: 40px;
        height: 40px;
        background: transparent;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-direction: column;
        gap: 5px;
        padding: 0;
    }

    .mobile-hamburger span {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--text-primary);
        border-radius: 2px;
    }

    /* Mobile overlay sidebar */
    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1002;
    }

    .mobile-sidebar-overlay.active {
        display: block;
    }

    /* Mobile sidebar drawer */
    .mobile-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1003;
        flex-direction: column;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .mobile-sidebar.active {
        display: flex;
        transform: translateX(0);
    }

    .mobile-sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        height: 56px;
        box-sizing: border-box;
    }

    .mobile-sidebar-close {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 8px;
        color: var(--text-primary);
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-sidebar-nav {
        flex: 1;
        overflow-y: auto;
        padding: 12px 0;
    }

    .mobile-sidebar-main-nav {
        padding: 8px 12px;
    }

    .mobile-sidebar-main-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border-radius: 12px;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        transition: all 0.2s ease;
        font-size: 15px;
        font-weight: 500;
    }

    .mobile-sidebar-main-item:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .mobile-sidebar-main-item.active {
        background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
        color: #fff;
    }

    .mobile-sidebar-sub-nav {
        padding: 8px 12px;
    }

    .mobile-sidebar-category-item {
        display: block;
        padding: 10px 16px;
        border-radius: 8px;
        color: rgba(255, 255, 255, 0.6);
        text-decoration: none;
        font-size: 14px;
        transition: all 0.2s ease;
    }

    .mobile-sidebar-category-item:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .mobile-sidebar-category-item.active {
        background: rgba(102, 126, 234, 0.2);
        color: #a5b4fc;
        border-left: 3px solid #667eea;
    }

    .mobile-sidebar-legal {
        padding: 12px 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .mobile-sidebar-legal a {
        display: block;
        padding: 10px 12px;
        color: rgba(255, 255, 255, 0.5);
        text-decoration: none;
        font-size: 13px;
        border-radius: 6px;
        transition: all 0.2s;
    }

    .mobile-sidebar-legal a:hover {
        background: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.8);
    }

    /* Mobile bottom navigation bar */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: rgba(15, 15, 26, 0.98);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border-color);
        z-index: 999;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 16px;
        color: rgba(255, 255, 255, 0.5);
        text-decoration: none;
        transition: all 0.2s ease;
        flex: 1;
    }

    .mobile-bottom-nav-item:hover,
    .mobile-bottom-nav-item.active {
        color: var(--primary-color);
    }

    .mobile-bottom-nav-item svg {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .mobile-bottom-nav-item span {
        font-size: 11px;
        font-weight: 500;
    }

    /* Floating button - move to bottom on mobile */
    #gdleads-float-btn {
        top: auto !important;
        bottom: 80px !important;
        transform: none !important;
        right: 16px !important;
        width: 52px !important;
        height: auto !important;
        border-radius: 50% !important;
        padding: 14px !important;
    }

    #gdleads-float-btn:hover {
        transform: translateX(-6px) !important;
    }

    #gdleads-float-btn span {
        display: none !important;
    }

    /* Flash messages mobile */
    .flash-messages {
        top: 70px;
        max-width: 95%;
    }

    /* Popup overlays mobile */
    .popup-overlay .popup-content {
        width: 95%;
        height: 85vh;
        max-width: 100%;
    }

    /* Hero section mobile */
    .hero {
        padding: 100px 20px 60px;
        min-height: auto;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-stats {
        gap: 16px;
    }

    .stat-number {
        font-size: 22px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .section-header p {
        font-size: 16px;
    }

    /* Content containers */
    .content-container {
        padding: 16px !important;
    }

    /* Articles / Videos grid - mobile friendly */
    .articles-grid,
    .videos-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Filter/search box */
    .filter-box {
        padding: 12px !important;
    }

    .filter-form {
        flex-direction: column !important;
    }

    .filter-box .filter-input {
        width: 100% !important;
    }

    .filter-btn {
        width: 100% !important;
        text-align: center;
    }

    /* Articles list header */
    .articles-header {
        margin-bottom: 20px !important;
    }

    .articles-header h1 {
        font-size: 22px !important;
    }

    /* Article detail */
    .article-detail {
        border-radius: 12px !important;
    }

    .article-header {
        padding: 20px 20px 16px !important;
    }

    .article-title {
        font-size: 24px !important;
    }

    .article-body {
        padding: 20px 20px !important;
        font-size: 15px !important;
    }

    .article-body h1 { font-size: 22px !important; }
    .article-body h2 { font-size: 20px !important; }
    .article-body h3 { font-size: 17px !important; }

    .cta-card {
        padding: 24px 16px !important;
    }

    .cta-title {
        font-size: 20px !important;
    }

    .cta-btn {
        width: 100%;
        justify-content: center;
    }

    /* Video detail */
    .video-detail {
        border-radius: 12px !important;
    }

    .video-header {
        padding: 20px 20px 16px !important;
    }

    .video-title {
        font-size: 22px !important;
    }

    .video-description {
        padding: 20px 20px !important;
        font-size: 15px !important;
    }

    /* Back link */
    .back-link {
        margin-bottom: 16px !important;
        font-size: 13px !important;
    }

    /* Empty state */
    .empty-state {
        padding: 48px 16px !important;
    }

    /* Footer mobile */
    .footer-container {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    /* Login / Register pages */
    .login-container,
    .register-container {
        padding: 20px !important;
    }

    /* Profile page */
    .profile-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    /* Dashboard pages */
    .dashboard-stats,
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    /* Analytics dashboard popup - mobile */
    #secret-dashboard > div {
        width: 95% !important;
        padding: 20px !important;
        max-height: 85vh !important;
    }

    #secret-dashboard > div > div:first-child > div:first-child > div:first-child > div:last-child > div > div > div[style*="grid"] {
        grid-template-columns: 1fr 1fr !important;
    }

    #secret-dashboard > div > div:first-child > div:first-child > div:first-child > div:last-child > div > div:last-child > div > div[style*="grid"] {
        grid-template-columns: 1fr 1fr !important;
    }

    #secret-dashboard > div > div:first-child > div:first-child > div:first-child > div:last-child > div > div:last-child > div > div > div {
        font-size: 12px !important;
    }

    /* Bundle modal mobile */
    .bundle-modal-content {
        width: 95% !important;
        padding: 16px !important;
    }

    /* Conversation / messages */
    .conversation-page {
        height: calc(100vh - 64px) !important;
    }

    .message {
        max-width: 85% !important;
    }

    /* Messages list */
    .messages-list {
        padding-bottom: 80px !important;
    }

    /* Image/video modal */
    .image-modal img,
    .video-modal video {
        max-width: 100% !important;
        max-height: 80% !important;
    }

    /* Report modal */
    .report-modal {
        width: 95% !important;
        padding: 16px !important;
    }

    .report-reasons {
        gap: 6px !important;
    }

    .report-reason-option {
        padding: 10px !important;
    }
}

/* ========================================
   Tablet Responsive (769px - 1024px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar-nav {
        width: 80px !important;
    }

    .sidebar-text {
        display: none !important;
    }

    .sidebar-main-item .sidebar-text {
        display: none !important;
    }

    .sidebar-main-nav {
        padding: 12px 8px !important;
    }

    .sidebar-main-item {
        padding: 12px !important;
        justify-content: center !important;
    }

    .sidebar-sub-nav {
        padding: 8px !important;
    }

    .sidebar-category-item {
        padding: 10px !important;
        font-size: 12px !important;
    }

    .sidebar-badge {
        right: 8px !important;
    }

    main,
    #main-content {
        margin-left: 80px !important;
        width: calc(100% - 80px) !important;
    }

    .sidebar-legal {
        padding: 12px 8px !important;
    }

    .sidebar-more-btn {
        width: 100% !important;
    }

    /* Tablet: hide mobile elements */
    .mobile-topbar,
    .mobile-sidebar-overlay,
    .mobile-sidebar,
    .mobile-bottom-nav {
        display: none !important;
    }

    /* Adjust floating button */
    #gdleads-float-btn {
        right: 0 !important;
    }

    /* Grid adjustments */
    .articles-grid,
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    }

    /* Article detail - tablet */
    .article-header {
        padding: 28px 32px 24px !important;
    }

    .article-body {
        padding: 24px 32px !important;
    }

    .video-header {
        padding: 28px 32px 24px !important;
    }

    .video-description {
        padding: 24px 32px !important;
    }
}

/* ========================================
   Default (Desktop > 1024px) - Hide mobile elements
   ======================================== */
@media (min-width: 1025px) {
    .mobile-topbar,
    .mobile-sidebar-overlay,
    .mobile-sidebar,
    .mobile-bottom-nav {
        display: none !important;
    }
}
