/* ==========================================================================
   XSUB ONLINE PLATFORM - UNIFIED STYLE SHEET
   ========================================================================== */

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --bg-dark: #07090e;
    --bg-sidebar: rgba(11, 14, 23, 0.85);
    --bg-card: rgba(20, 26, 42, 0.45);
    --bg-card-hover: rgba(28, 36, 58, 0.6);
    --border-glass: rgba(255, 255, 255, 0.06);
    
    --primary: #6366f1;       /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.3);
    --secondary: #8b5cf6;     /* Purple */
    --accent: #10b981;        /* Emerald (Success/Views) */
    --warning: #f59e0b;       /* Amber */
    --danger: #ef4444;        /* Rose */
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #0b0e17;
    
    --sidebar-width: 260px;
    --transition-smooth: all 0.3s ease;
    --radius-lg: 16px;
    --radius-md: 10px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* --- Glow Highlights --- */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.2;
    pointer-events: none;
}

.bg-glow-1 {
    top: -10%;
    left: -10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.bg-glow-2 {
    bottom: -10%;
    right: -10%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
}

.bg-glow-3 {
    top: 30%;
    right: 20%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

/* --- LANDING PAGE CUSTOM STYLES --- */
.landing-body {
    padding: 0;
    margin: 0;
}

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 2rem;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo-x {
    color: var(--primary);
    text-shadow: 0 0 12px var(--primary-glow);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

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

.btn-nav {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-md);
    color: var(--text-main) !important;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.btn-nav.btn-primary:hover {
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 6rem 1rem 4rem 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.badge-premium {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.hero-section h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, #a5b4fc 0%, var(--primary) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 3rem;
}

.hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.btn-hero-company, .btn-hero-creator {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    text-decoration: none;
    text-align: left;
    transition: var(--transition-smooth);
}

.btn-hero-company:hover, .btn-hero-creator:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-hero-company { border-left: 4px solid var(--primary); }
.btn-hero-creator { border-left: 4px solid var(--accent); }

.hero-actions .icon {
    font-size: 2.2rem;
}

.text-group {
    display: flex;
    flex-direction: column;
}

.action-lbl {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-main);
}

.action-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Stats Section */
.stats-section {
    padding: 3rem 0;
}

.stat-bar-box {
    background: rgba(13, 16, 27, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    gap: 1rem;
}

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

.stat-val {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-item:nth-child(3) .stat-val { color: var(--accent); }
.stat-item:nth-child(4) .stat-val { color: var(--warning); }

.stat-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

/* Features Section */
.features-section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-title h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
}

.section-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
}

.feat-icon {
    font-size: 2.5rem;
    margin-bottom: 1.2rem;
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
}

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

.landing-footer {
    text-align: center;
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
}


/* --- DASHBOARD LAYOUT & MODULES --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    padding: 2rem 1.2rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 2.5rem;
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.7rem 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.04));
    border-color: rgba(99, 102, 241, 0.25);
    font-weight: 600;
}

.nav-item .icon {
    margin-right: 0.6rem;
    font-size: 1rem;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.2rem;
}

.user-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info strong {
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.user-info span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Main Content area */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2.5rem;
    max-width: 1200px;
    width: calc(100% - var(--sidebar-width));
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1.2rem;
}

.header-title .subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.header-title h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2rem;
    margin-top: 0.2rem;
}

.header-wallet {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 0.6rem 1.2rem;
    text-align: right;
}

.wallet-lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    display: block;
}

.wallet-val {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Cards & Section controls */
.section-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.section-card.active {
    display: block;
}

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

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.2rem;
}

/* Tables styling */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.db-fields-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.db-fields-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    padding: 0.8rem 1rem;
}

.db-fields-table td {
    font-size: 0.88rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding: 0.9rem 1rem;
}

.db-fields-table tr:hover td {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.01);
}

.badge-status {
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    display: inline-block;
    margin-top: 0.2rem;
}

.text-green {
    color: var(--accent) !important;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group textarea {
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 0.7rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.field-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.btn-submit {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Dual Column Rules Simulator */
.rules-sim-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.simulator-card {
    background: rgba(13, 16, 27, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
}

.simulator-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.sim-intro {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.rules-info-panel h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
}

.rule-mini-card {
    background: rgba(255, 255, 255, 0.01);
    border-left: 3px solid var(--primary);
    padding: 0.7rem 1rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 1rem;
}

.rule-mini-card h5 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.rule-mini-card p {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.total-res-bar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-earning {
    display: flex;
    flex-direction: column;
}

.total-earning .lbl {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.total-earning .val {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
}

.commission-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Reward Dual Card */
.reward-dual-card {
    background: rgba(13, 16, 27, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.dual-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.8rem;
    margin-bottom: 1.2rem;
}

.dual-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

/* Burger Button Style */
.burger-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
    outline: none;
}

.burger-line {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active Burger State -> Cross (X) */
.burger-menu-btn.active .burger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.burger-menu-btn.active .burger-line:nth-child(2) {
    opacity: 0;
}
.burger-menu-btn.active .burger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.2rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
    }
    
    .sidebar-header {
        margin-bottom: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .burger-menu-btn {
        display: flex;
    }
    
    .sidebar-nav {
        display: none;
        width: 100%;
        margin-top: 1rem;
    }
    
    .sidebar-nav.mobile-open {
        display: block;
    }
    
    .sidebar-nav ul {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .sidebar-nav li {
        width: 100%;
    }
    
    .sidebar-nav .nav-item {
        width: 100%;
        display: flex;
        align-items: center;
        padding: 0.8rem 1rem;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: var(--radius-md);
        transition: all 0.3s ease;
    }
    
    .sidebar-nav .nav-item:hover, .sidebar-nav .nav-item.active {
        background: rgba(139, 92, 246, 0.15);
        border-color: var(--primary);
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }
    
    .rules-sim-grid, .hero-actions {
        grid-template-columns: 1fr;
    }
    
    .stat-bar-box {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
}

/* Responsive Landing Page Navigation */
.landing-header {
    position: relative;
    width: 100%;
}

.landing-header .burger-menu-btn {
    display: none;
}

@media (max-width: 1024px) {
    .landing-header .burger-menu-btn {
        display: flex;
    }
    
    .nav-links {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(13, 16, 27, 0.98);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-md);
        padding: 1.5rem;
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem !important;
        z-index: 10000;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
    
    .nav-links.mobile-open {
        display: flex !important;
    }
    
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 0.8rem;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: var(--radius-sm);
    }
    
    .nav-links .btn-nav {
        background: rgba(139, 92, 246, 0.15) !important;
        border-color: var(--primary) !important;
    }
    
    .nav-links .lang-selector-widget {
        display: flex;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

/* ==========================================================================
   UNIFIED SUPPORT CHAT SYSTEM STYLES (Admin, Company & Creator)
   ========================================================================== */
:root {
    --admin-glow: rgba(139, 92, 246, 0.35);
}

.chat-sim-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 580px;
    background: rgba(13, 16, 27, 0.45);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chat-users-sidebar {
    background: rgba(11, 14, 23, 0.7);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-search {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-search input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
    color: var(--text-main);
    outline: none;
}

.chat-user-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
}

.chat-user-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.chat-user-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(99, 102, 241, 0.04));
    border-left: 3px solid var(--secondary);
}

.chat-user-avatar {
    position: relative;
    font-size: 1.6rem;
}

.status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    background: var(--accent);
    border: 2px solid var(--bg-dark);
    border-radius: 50%;
}

.chat-user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

.chat-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-user-role {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.chat-main-viewport {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header-bar {
    padding: 0.9rem 1.5rem;
    background: rgba(11, 14, 23, 0.4);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.chat-messages-area {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    background: rgba(7, 9, 14, 0.2);
}

.msg-bubble-wrapper {
    display: flex;
    width: 100%;
}

.msg-bubble-wrapper.msg-incoming { justify-content: flex-start; }
.msg-bubble-wrapper.msg-outgoing { justify-content: flex-end; }

.msg-bubble {
    max-width: 65%;
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.5;
    position: relative;
}

.msg-incoming .msg-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.msg-outgoing .msg-bubble {
    background: var(--secondary);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 12px var(--admin-glow);
}

.msg-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: block;
    text-align: right;
}

.msg-outgoing .msg-time {
    color: rgba(255, 255, 255, 0.7);
}

.chat-input-bar {
    padding: 1rem 1.5rem;
    background: rgba(11, 14, 23, 0.5);
    border-top: 1px solid var(--border-glass);
    display: flex;
    gap: 1rem;
}

.chat-input-bar input {
    flex-grow: 1;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
}

.chat-input-bar input:focus {
    border-color: var(--secondary);
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.chat-empty-state .icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    width: fit-content;
    margin-left: 1.5rem;
    display: none;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

.btn-toggle-status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: none;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-toggle-status.suspended-btn {
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.btn-toggle-status.suspended-btn:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.btn-toggle-status.active-btn {
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent);
    background: rgba(16, 185, 129, 0.05);
}

.btn-toggle-status.active-btn:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.btn-open-chat-table {
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--secondary);
    background: rgba(139, 92, 246, 0.05);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-heading);
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-open-chat-table:hover {
    background: var(--secondary);
    color: white;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

/* ==========================================================================
   PREMIUM CUSTOM SCROLLBARS AND PORTAL-SPECIFIC SUPPORT CHAT STYLES
   ========================================================================== */

/* Premium Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Portal-Specific Bubble Theme Colors */

/* 1. Creator Hub Support Chat (Emerald Theme) */
.creator-hub-body .msg-outgoing .msg-bubble {
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.creator-hub-body .msg-outgoing .msg-time {
    color: rgba(255, 255, 255, 0.7);
}

/* 2. Company Dashboard Support Chat (Indigo/Blue Theme) */
.company-dashboard-body .msg-outgoing .msg-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.company-dashboard-body .msg-outgoing .msg-time {
    color: rgba(255, 255, 255, 0.7);
}

/* 3. Admin Dashboard Support Chat (Purple Theme) */
.admin-dashboard-body .msg-outgoing .msg-bubble {
    background: var(--secondary);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 12px var(--admin-glow);
}
.admin-dashboard-body .msg-outgoing .msg-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Support Chat Stacking on Mobile/Tablet */
@media (max-width: 768px) {
    .chat-sim-container {
        grid-template-columns: 1fr !important;
        height: auto !important;
        min-height: 480px;
    }
    
    .chat-users-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
        max-height: 180px;
    }
    
    .chat-messages-area {
        padding: 1rem;
        gap: 0.8rem;
    }
    
    .msg-bubble {
        max-width: 85%;
    }
}

/* ==========================================================================
   HIGH SPECIFICITY OVERRIDES FOR CREATOR & BRAND SUPPORT PORTALS
   ========================================================================== */

#support .chat-sim-container {
    display: block !important;
    background: rgba(13, 16, 27, 0.45) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden !important;
    margin-top: 1rem !important;
}

#support .chat-messages-area {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.2rem !important;
    background: rgba(7, 9, 14, 0.25) !important;
    padding: 1.5rem !important;
    overflow-y: auto !important;
    height: 380px !important;
}

#support .chat-input-bar {
    display: flex !important;
    gap: 1rem !important;
    padding: 1.2rem 1.5rem !important;
    background: rgba(11, 14, 23, 0.6) !important;
    border-top: 1px solid var(--border-glass) !important;
    align-items: center !important;
}

#support-chat-input-field {
    flex-grow: 1 !important;
    background: var(--bg-dark) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.75rem 1.2rem !important;
    color: var(--text-main) !important;
    font-family: var(--font-body) !important;
    font-size: 0.88rem !important;
    outline: none !important;
    transition: border-color 0.25s ease !important;
}

#support-chat-input-field:focus {
    border-color: var(--accent) !important;
}

.company-dashboard-body #support-chat-input-field:focus {
    border-color: var(--primary) !important;
}

#support .btn-submit {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    border-radius: var(--radius-md) !important;
    padding: 0.75rem 1.8rem !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    border: none !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.creator-hub-body #support .btn-submit {
    background: var(--accent) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}
.creator-hub-body #support .btn-submit:hover {
    background: #059669 !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}

.company-dashboard-body #support .btn-submit {
    background: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2) !important;
}
.company-dashboard-body #support .btn-submit:hover {
    background: #4f46e5 !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3) !important;
}


