/* ============================================
   FENIX WEB CHAT — PREMIUM DESIGN SYSTEM v2
   Material Symbols + Glassmorphism + Gradients
   ============================================ */

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

/* ─── Material Symbols Config ────────────────── */
.material-symbols-rounded {
    font-variation-settings:
        'FILL' 1,
        'wght' 500,
        'GRAD' 0,
        'opsz' 24;
    font-size: 24px;
    vertical-align: middle;
    user-select: none;
}

/* ─── CSS Variables ──────────────────────────── */
:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #212121;
    --bg-tertiary: #181818;
    --bg-card: #212121;
    --bg-card-hover: #2b2b2b;
    --glass: #212121;
    --glass-border: #2c2c2c;
    --glass-hover: #2b2b2b;

    --purple: #8774e1;
    --purple-light: #9e8cf1;
    --purple-dark: #6c54d4;
    --teal: #5bb679;
    --teal-light: #7cdb99;
    --pink: #d35f8d;
    --pink-light: #e67fa9;
    --gold: #f4c542;
    --green: #5bb679;
    --red: #f25555;
    --orange: #e17055;
    --blue: #4a8bcf;

    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #ffffff;
    --text-accent: var(--purple);
    --text-accent-blue: #ffffff;

    --gradient-main: linear-gradient(135deg, var(--purple) 0%, #a29bfe 100%);
    --gradient-text: var(--text-accent-blue);
    --gradient-teal: linear-gradient(135deg, var(--teal) 0%, #55efc4 100%);
    --gradient-gold: linear-gradient(135deg, var(--gold) 0%, #ffeaa7 100%);
    --gradient-blue: linear-gradient(135deg, var(--blue) 0%, #74b9ff 100%);
    --bg-header: rgba(6, 6, 20, 0.94);
    --bg-bubble-received: #212121;
    --bg-bubble-sent: var(--purple);
    --bg-app-wallpaper: url('../img/wallpaperflare.com_wallpaper.jpg');

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 5px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.4);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 50%;

    --transition: all 0.2s ease;
    --transition-fast: all 0.1s ease;
    --transition-slow: all 0.3s ease;
}

/* ─── Light Mode Overrides ───────────────────── */
body.light-mode {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9f9f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f0;
    --glass: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-hover: rgba(0, 0, 0, 0.05);
    --bg-header: rgba(255, 255, 255, 0.95);
    --bg-bubble-received: #ffffff;
    --bg-bubble-sent: #effdde;
    --text-sent: #0f0f0f;
    --bg-app-wallpaper: url('../img/white-bacgroud.jpg');

    --text-primary: #0f0f0f;
    --text-secondary: #5a5f64;
    --text-muted: #707579;
    --text-accent-blue: #24A1DE;

    --purple: #6c54d4;
    --gradient-text: var(--text-accent-blue);
    --gradient-bg: #f0f2f5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.12);
}

body.light-mode .session-overlay {
    background: rgba(255, 255, 255, 0.95) !important;
}


/* Transition for the whole app */
body,
.screen,
.chat-header,
.chat-input-area,
.glass-card,
.menu-card,
.tinder-card,
.message,
.chat-screen {
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.4s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-app-wallpaper) center/cover fixed !important;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.color-white {
    color: var(--text-primary) !important;
}

.always-white {
    color: #ffffff !important;
}

/* ─── Premium Preloader ──────────────────────── */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.preloader-logo {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 24px;
    overflow: hidden;
    animation: preloaderPulse 2s infinite ease-in-out;
}

.preloader-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preloader-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: preloaderSpin 1.5s linear infinite;
    display: none;
    /* Already has pulse, spin might be overkill */
}

.preloader-text {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 4px;
    color: white;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.preloader-bar {
    width: 160px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.preloader-progress {
    width: 40%;
    height: 100%;
    background: var(--gradient-main);
    border-radius: 2px;
    animation: preloaderProgress 2s infinite ease-in-out;
}

@keyframes preloaderPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(135, 116, 225, 0.2);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(135, 116, 225, 0.4);
    }
}

@keyframes preloaderSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes preloaderProgress {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(250%);
    }
}

/* Icon Flickering Fix */
body.loading .material-symbols-rounded {
    visibility: hidden;
}

body.loading .app-container {
    opacity: 0;
}

.app-container {
    transition: opacity 0.8s ease;
}

/* ─── Animated Background ────────────────────── */
.bg-particles {
    display: none;
}

/* ─── App Container ──────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Screens ────────────────────────────────── */
.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    animation: screenFadeIn 0.35s ease;
}

.screen.active {
    display: flex;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Logo & Branding ────────────────────────── */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0 40px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-main);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 20px;
    box-shadow: var(--shadow-glow);
    animation: logoPulse 3s infinite ease-in-out;
    position: relative;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-xl);
    background: var(--gradient-main);
    z-index: -1;
    opacity: 0.4;
    filter: blur(12px);
}

@keyframes logoPulse {

    0%,
    100% {
        box-shadow: 0 4px 30px rgba(124, 108, 240, 0.35);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 4px 50px rgba(124, 108, 240, 0.5);
        transform: scale(1.03);
    }
}

.logo-title {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
    line-height: 1.5;
}

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

.greeting-text {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

/* ─── Input Fields ───────────────────────────── */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px !important;
    pointer-events: none;
    transition: var(--transition);
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
}

.input-field.has-icon {
    padding-left: 46px;
}

.input-field:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(124, 108, 240, 0.15);
    background: rgba(255, 255, 255, 0.07);
}

.input-field:focus+.input-icon,
.input-with-icon:focus-within .input-icon {
    color: var(--purple-light);
}

.input-field::placeholder {
    color: var(--text-muted);
}

textarea.input-field {
    resize: none;
    height: 120px;
}

/* ─── Buttons ────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: var(--transition-fast);
}

.btn:hover::after {
    background: rgba(255, 255, 255, 0.08);
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary:hover {
    background: var(--glass-hover);
    border-color: var(--purple-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--purple);
    background: rgba(124, 108, 240, 0.08);
}

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

.btn-danger {
    background: linear-gradient(135deg, var(--red), #c0392b);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    width: auto;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ─── Cards ──────────────────────────────────── */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}

.glass-card:hover {
    background: var(--glass-hover);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ─── Menu Grid ──────────────────────────────── */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 24px 0;
}

.menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    min-height: 140px;
}

.menu-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: white;
    position: relative;
}

.menu-icon-wrap::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    z-index: -1;
    opacity: 0.35;
    filter: blur(10px);
}

.menu-icon-wrap.purple {
    background: var(--gradient-main);
}

.menu-icon-wrap.purple::after {
    background: var(--gradient-main);
}

.menu-icon-wrap.teal {
    background: var(--gradient-teal);
}

.menu-icon-wrap.teal::after {
    background: var(--gradient-teal);
}

.menu-icon-wrap.pink {
    background: linear-gradient(135deg, var(--pink), var(--purple));
}

.menu-icon-wrap.pink::after {
    background: linear-gradient(135deg, var(--pink), var(--purple));
}

.menu-icon-wrap.gold {
    background: var(--gradient-gold);
}

.menu-icon-wrap.gold::after {
    background: var(--gradient-gold);
}

.menu-icon-wrap .material-symbols-rounded {
    font-size: 28px;
}

.menu-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-accent-blue);
    transition: var(--transition);
}

.menu-card:hover .menu-label {
    color: var(--text-primary);
}

/* ─── Active Session Banner ──────────────────── */
.active-session-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(46, 213, 115, 0.06);
    border: 1px solid rgba(46, 213, 115, 0.2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    margin-top: 12px;
    transition: var(--transition);
}

.active-session-banner:hover {
    background: rgba(46, 213, 115, 0.1);
    border-color: rgba(46, 213, 115, 0.35);
}

/* ─── Screen Header ──────────────────────────── */
.screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 16px;
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.back-btn .material-symbols-rounded {
    font-size: 20px;
}

.back-btn:hover {
    background: var(--glass-hover);
    border-color: var(--purple);
}

.screen-title {
    font-size: 20px;
    font-weight: 700;
}

/* ─── Specialist Cards ───────────────────────── */
.specialist-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.specialist-card {
    display: flex;
    gap: 16px;
    align-items: center;
    cursor: pointer;
    padding: 16px;
}

.specialist-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.specialist-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.specialist-info {
    flex: 1;
    min-width: 0;
}

.specialist-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
}

.specialist-desc {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.specialist-meta {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.specialist-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
    box-shadow: 0 0 6px var(--green);
    animation: onlinePulse 2s infinite;
}

@keyframes onlinePulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 6px var(--green);
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 12px var(--green);
    }
}

/* ─── Tinder Swipe Card ──────────────────────── */
.tinder-container {
    width: 100%;
    padding: 20px 0 80px 0;
    /* Pastda tugmalar uchun yetarli joy */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tinder-card {
    width: 92%;
    max-width: 380px;
    height: auto;
    /* Avtomatik uzayadi */
    border-radius: 24px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.4s ease;
    box-shadow: var(--shadow-lg);
    position: relative;
    user-select: none;
    margin: 0 auto;
    overflow: hidden;
    /* Ichki kontentni qirqish emas, balki tartiblash uchun */
}



.tinder-card.appear {
    animation: cardAppear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cardAppear {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.tinder-photo {
    width: 100%;
    height: auto;
    min-height: 200px;
    background: #1a1a1a;
    position: relative;
    overflow: hidden;
}

.tinder-photo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}



/* Soya olib tashlandi */
.tinder-photo::after {
    display: none;
}

.tinder-details {
    padding: 24px;
    text-align: left;
    display: block;
    /* Flexbox cheklovlarini olib tashlash */
}

.tinder-name {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
    line-height: 1.2;
}

.tinder-spec {
    font-size: 15px;
    color: var(--purple-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.tinder-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.tinder-separator {
    height: 1px;
    background: var(--glass-border);
    margin: 4px 0 16px 0;
    border: none;
    width: 100%;
}

.tinder-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    border-top: 1px solid var(--glass-border);
    padding-top: 12px;
}

.tinder-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-primary);
}

/* Soddalashtirilgan mutaxassislar ro'yxati */
.specialist-list-simple {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.specialist-item-simple {
    padding: 16px 20px;
    cursor: pointer;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    transition: var(--transition);
}

.specialist-item-simple:hover {
    background: var(--glass-hover);
    border-color: var(--purple);
    transform: translateX(4px);
}

.tinder-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    width: 95%;
    max-width: 380px;
    justify-content: center;
    padding-bottom: 20px;
}

.tinder-btn {
    height: 54px;
    border-radius: 16px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 14px;
    padding: 0 16px;
    color: white;
}

.tinder-btn .material-symbols-rounded {
    font-size: 24px;
}

.tinder-btn.skip {
    flex: 1;
    background: #0088cc;
    color: #ffffff;
}

.tinder-btn.connect {
    flex: 1.5;
    background: #0088cc;
    color: #ffffff;
}

.tinder-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-text {
    line-height: 1;
}



/* ─── Support Groups ─────────────────────────── */
.group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    text-decoration: none;
    color: var(--text-primary);
}

.group-emoji {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.group-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

.group-arrow {
    color: var(--text-muted);
}

/* ─── Chat Window ────────────────────────────── */
.chat-screen {
    padding: 0 !important;
    height: 100vh;
    max-height: 100vh;
    background: transparent !important;
    position: relative;
}

.chat-screen>* {
    position: relative;
    z-index: 1;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.chat-header .header-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.chat-header .header-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

body.light-mode .chat-header .header-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ─── Global Actions ────────────────────────── */
.global-actions {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 900;
    /* Lower than image preview (1000) */
}

.global-actions .header-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.global-actions .header-action-btn:hover {
    transform: scale(1.05);
    background: var(--bg-card-hover);
}

.global-actions .dropdown-menu {
    top: 50px;
    right: 0;
}

/* ─── Dropdown Menu ────────────────────────── */
.dropdown-menu {
    position: absolute;
    top: 60px;
    right: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    padding: 8px 0;
    display: none;
    transform-origin: top right;
    animation: menuAppear 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menuAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--glass-hover);
}

.dropdown-item .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-secondary);
}

.chat-header .specialist-avatar {
    width: 38px;
    height: 38px;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-header-info {
    flex: 1;
    min-width: 0;
    padding-right: 4px;
    /* Slight breathing room before timer */
}

.chat-header-name {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-status {
    font-size: 12px;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: rgba(244, 197, 66, 0.12);
    border-radius: var(--radius-xl);
    color: var(--yellow);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.chat-timer.warning {
    background: rgba(255, 71, 87, 0.12);
    border-color: rgba(255, 71, 87, 0.3);
    color: var(--red);
    animation: timerPulse 1s infinite;
}

@keyframes timerPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ─── Chat Messages ──────────────────────────── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.message {
    max-width: 82%;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    position: relative;
    animation: messageIn 0.25s ease;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

.message.message-media-only {
    background: transparent !important;
    border: none !important;
    padding: 2px !important;
    box-shadow: none !important;
}

.message.message-media-only .message-meta {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 3px 6px;
    color: white;
    margin: 0;
}

.image-wrapper {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    max-width: 240px;
    display: inline-block;
}

.image-wrapper.blur .message-image {
    filter: blur(15px);
    transition: filter 0.3s ease;
}

.specialist-profile {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-bottom: 40px;
}

.download-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-overlay);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
}

.image-wrapper.blur .download-overlay {
    display: flex;
}

.message-content {
    font-size: 14px;
    line-height: 1.5;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.65;
}

.message-status .material-symbols-rounded {
    font-size: 14px !important;
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 14;
}

.message-status.read .material-symbols-rounded {
    color: var(--teal-light);
}

/* ─── Voice Message ──────────────────────────── */
.voice-message {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

/* Play/Pause tugmasining umumiy ko'rinishi */
.voice-play-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.voice-play-btn .material-symbols-rounded {
    font-size: 20px !important;
}

/* Waveform umumiy */
.voice-waveform {
    flex: 1;
    height: 30px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.voice-waveform .bar {
    width: 3px;
    border-radius: 2px;
    transition: var(--transition-fast);
}

.voice-duration {
    font-size: 12px;
    flex-shrink: 0;
    min-width: 35px;
    font-variant-numeric: tabular-nums;
}

/* --- Dark Mode & Umumiy qoidalar --- */
/* Qabul qilingan xabar (Received) */
.message-content {
    /* Play tugmasi olingan xabarda o'ziga xos purple bo'ladi */
}

.message:not(.sent) .voice-play-btn {
    background: var(--purple-dark);
    color: white;
}

.message:not(.sent) .voice-play-btn:hover {
    background: var(--purple);
}

.message:not(.sent) .voice-waveform .bar {
    background: rgba(135, 116, 225, 0.3);
    /* Purple transparent */
}

.message:not(.sent) .voice-waveform .bar.active {
    background: var(--purple-dark);
}

.message:not(.sent) .voice-duration {
    color: var(--text-secondary);
}

/* Yuborilgan xabar (Sent) (Bunda orqa fon purple, shuning uchun hammasi oq) */
.message.sent .voice-play-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.message.sent .voice-play-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.message.sent .voice-waveform .bar {
    background: rgba(255, 255, 255, 0.4);
}

.message.sent .voice-waveform .bar.active {
    background: white;
}

.message.sent .voice-duration {
    color: rgba(255, 255, 255, 0.85);
}

/* --- Light Mode qoidalari --- */
body.light-mode .message:not(.sent) .voice-play-btn {
    background: #76c84d;
    color: white;
}

body.light-mode .message:not(.sent) .voice-play-btn:hover {
    background: #68bd42;
}

body.light-mode .message:not(.sent) .voice-waveform .bar {
    background: #d4d4d4;
}

body.light-mode .message:not(.sent) .voice-waveform .bar.active {
    background: #76c84d;
}

body.light-mode .message:not(.sent) .voice-duration {
    color: #707579;
}

/* Light Mode da Yuborilgan xabar orqa foni #effdde (och yashil). Telegram uslubidagi yashil ranglar */
body.light-mode .message.sent .voice-play-btn {
    background: #76c84d;
    color: white;
}

body.light-mode .message.sent .voice-play-btn:hover {
    background: #68bd42;
}

body.light-mode .message.sent .voice-waveform .bar {
    background: #b0dca3;
}

body.light-mode .message.sent .voice-waveform .bar.active {
    background: #4fae33;
}

body.light-mode .message.sent .voice-duration {
    color: #4fae33;
}

/* ─── Image Message ──────────────────────────── */
.message-image {
    max-width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.message-image:hover {
    opacity: 0.9;
}

/* ─── Video Messages ─────────────────────────── */
.video-note-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: #000;
    cursor: pointer;
}

.video-note-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.video-note-wrapper.playing .video-note-play-icon {
    opacity: 0;
}

.video-note-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-wrapper {
    max-width: 260px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.message-video {
    width: 100%;
    display: block;
}

/* ─── Sticker Message ────────────────────────── */
.message.sticker-msg {
    background: none !important;
    border: none !important;
    padding: 4px;
}

/* ─── Typing Indicator ───────────────────────── */
.typing-indicator {
    display: none;
    align-self: flex-start;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 4px;
    gap: 5px;
    align-items: center;
}

.typing-indicator.show {
    display: flex;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.4s infinite;
}

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

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    30% {
        transform: translateY(-7px);
        opacity: 1;
    }
}

/* ─── Chat Input Area ────────────────────────── */
.chat-input-area {
    padding: 10px 16px;
    background: var(--bg-secondary);
    display: flex;
    align-items: flex-end;
    gap: 0;
    flex-wrap: nowrap;
    /* Ensure input items never stack vertically */
}

.chat-input-area.is-recording {
    align-items: center;
}

.chat-input-right-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 8px;
    gap: 4px;
}

.chat-input-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.chat-action-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.chat-action-btn .material-symbols-rounded {
    font-size: 26px;
    /* Telegram icons are slightly larger */
}

.chat-action-btn:hover {
    color: var(--text-primary);
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
    background: transparent;
}

.chat-input {
    width: 100%;
    height: 100%;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
    resize: none;
    max-height: 120px;
    min-height: 24px;
    line-height: 1.5;
}

.chat-input:focus {
    /* No border on focus */
}

.chat-input::placeholder {
    color: var(--text-muted);
}

/* ─── Voice Record / Send Button ────────────────────── */
.voice-record-btn,
.send-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: #ffffff;
    background-color: #0088cc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.send-btn {
    background: transparent;
    color: #76c84d;
}

.voice-record-btn .material-symbols-rounded,
.send-btn .material-symbols-rounded {
    font-size: 28px;
}

.voice-record-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.voice-record-btn.recording {
    background: #76c84d;
    color: white;
    animation: recordPulse 1.2s infinite;
}

@keyframes recordPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(118, 200, 77, 0.4);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 10px rgba(118, 200, 77, 0);
    }
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--gradient-main);
    border: none;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn .material-symbols-rounded {
    font-size: 22px;
}

.send-btn.show {
    display: flex;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* ─── Voice Recording UI ─────────────────────── */
.recording-ui {
    display: none;
    align-items: center;
    gap: 10px;
    flex: 1;
    padding: 8px 14px;
    background: rgba(135, 116, 225, 0.08);
    border: 1px solid rgba(135, 116, 225, 0.25);
    border-radius: var(--radius-xl);
}

.recording-ui.show {
    display: flex;
}

.recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--purple);
    animation: recordDot 1s infinite;
    flex-shrink: 0;
}

@keyframes recordDot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

@media (max-width: 400px) {
    .recording-ui {
        padding: 6px 10px;
        gap: 6px;
    }

    .chat-input-area {
        padding-left: 8px;
        padding-right: 8px;
    }

    .recording-cancel .cancel-text {
        display: none;
    }

    .recording-waveform {
        flex: 0 1 auto;
        overflow: hidden;
    }
}

.recording-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--red);
    min-width: 40px;
    font-variant-numeric: tabular-nums;
}

.recording-waveform {
    flex: 1;
    height: 24px;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow: hidden;
}

.recording-waveform .bar {
    width: 3px;
    background: var(--red);
    border-radius: 2px;
    opacity: 0.5;
    transition: height 0.1s ease;
}

.recording-cancel {
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.recording-cancel .material-symbols-rounded {
    font-size: 16px !important;
}

.recording-cancel:hover {
    color: var(--red);
}

/* ─── Sticker Picker ─────────────────────────── */
.sticker-picker {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    left: 20px;
    width: 320px;
    background: rgba(13, 13, 36, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    z-index: 200;
    padding: 12px;
}

.sticker-picker.show {
    display: block;
    animation: stickerFadeIn 0.2s ease;
}

@keyframes stickerFadeIn {
    from {
        transform: translateY(10px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.sticker-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    user-select: none;
}

.sticker-item:hover {
    background: var(--glass-hover);
    transform: scale(1.2);
}

.sticker-category-title {
    font-size: 11px;
    color: var(--text-muted);
    margin: 12px 0 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sticker-category-title:first-child {
    margin-top: 0;
}

/* ─── File Preview ───────────────────────────── */
.file-preview-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.file-preview-overlay.show {
    display: flex;
}

.file-preview-overlay img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-md);
}

.file-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.file-preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ─── Session Expired Overlay ────────────────── */
.session-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 500;
    overflow-y: auto;
    padding: 20px;
}

.session-overlay.show {
    display: flex;
    flex-direction: column;
}

.session-overlay-content {
    text-align: left;
    max-width: 420px;
    width: 100%;
    margin: auto;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    position: relative;
}



.session-overlay-icon {
    margin-bottom: 20px;
}

.session-overlay h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

.session-overlay p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* ─── Toast ──────────────────────────────────── */
/* ─── Toast ──────────────────────────────────── */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 10px 20px;
    color: var(--text-primary);
    font-size: 14px;
    z-index: 9999;
    transition: var(--transition);
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-bottom: 2px solid var(--green);
}

.toast.error {
    border-bottom: 2px solid var(--red);
}

.toast.warning {
    border-bottom: 2px solid var(--gold);
}

/* ─── Specialist Dashboard ───────────────────── */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.dashboard-greeting {
    font-size: 22px;
    font-weight: 700;
}

.session-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    cursor: pointer;
}

.session-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--gradient-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.session-card-info {
    flex: 1;
}

.session-card-name {
    font-size: 15px;
    font-weight: 600;
}

.session-card-time {
    font-size: 12px;
    color: var(--gold);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.no-sessions {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
}

.no-sessions p {
    font-size: 14px;
}

/* ─── Loading Spinner ────────────────────────── */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 20px auto;
}

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

/* ─── Request Form ───────────────────────────── */
.request-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.request-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    gap: 16px;
}

/* ─── Specialization Grid ────────────────────── */
.spec-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    cursor: pointer;
}

.spec-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.spec-name {
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}

.spec-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--glass);
    padding: 4px 10px;
    border-radius: var(--radius-xl);
}

/* ─── Session Warning Banner ─────────────────── */
.warning-banner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 71, 87, 0.1);
    border-bottom: 1px solid rgba(255, 71, 87, 0.25);
    color: var(--red);
    font-size: 13px;
    font-weight: 500;
    animation: warningPulse 2s infinite;
}

.warning-banner .material-symbols-rounded {
    font-size: 18px;
}

.warning-banner.show {
    display: flex;
}

@keyframes warningPulse {

    0%,
    100% {
        background: rgba(255, 71, 87, 0.08);
    }

    50% {
        background: rgba(255, 71, 87, 0.15);
    }
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
    }

    .tinder-card {
        max-width: 100%;
    }
}

@media (min-width: 768px) {
    .app-container {
        max-width: 100%;
        padding: 0;
    }

    .screen {
        max-width: 100%;
        margin: 0;
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        overflow-y: auto;
    }

    .chat-screen {
        overflow: hidden;
        background: var(--bg-app-wallpaper) center/cover fixed !important;
    }

    /* Контент экранов центрируется */
    .screen-header {
        max-width: 1000px;
        margin: 0 auto;
        padding-top: 40px;
        width: 100%;
    }

    .logo-container {
        padding-top: 100px;
    }

    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1000px;
        margin: 0 auto;
        gap: 20px;
        padding: 40px;
    }

    .active-session-banner {
        max-width: 1000px;
        margin: 0 auto;
    }

    .spec-grid,
    .specialist-list,
    .group-list,
    .request-form,
    #dashboardSessions {
        max-width: 800px;
        margin: 0 auto;
        width: 100%;
    }

    .tinder-card {
        max-width: 440px;
    }

    /* Чат растягивается на всю ширину (Edge-to-Edge) как в Telegram Web */
    /* Центральная колонка чата как в Telegram Web (Desktop) */
    .chat-header,
    .chat-messages,
    .chat-input-area {
        max-width: 740px !important;
        width: 100%;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .chat-header {
        border-radius: 0;
        background: var(--bg-header) !important;
        border-bottom: 1px solid var(--glass-border);
        padding: 12px 20px !important;
    }

    .chat-messages {
        padding: 30px 20px !important;
        gap: 12px;
    }

    .chat-input-area {
        border-radius: 0;
        background: var(--bg-secondary) !important;
        border-top: none;
        padding: 12px 16px !important;
        margin-bottom: 0;
    }

    .message {
        max-width: 600px;
        /* Контроль длины строки для удобочитаемости текста */
        padding: 12px 18px;
    }

    .message.sent {
        box-shadow: 0 4px 15px rgba(124, 108, 240, 0.25);
    }

    .message.received {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    /* Авторизация и Форма */
    .input-group,
    .btn:not(.btn-sm):not(.tinder-btn) {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .request-form .input-group,
    .request-form .btn {
        max-width: 600px;
    }
}

/* ─── Utility ────────────────────────────────── */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.flex-1 {
    flex: 1;
}

/* ─── System Message ─────────────────────────── */
.system-message {
    align-self: center;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 14px;
    border-radius: var(--radius-xl);
    margin: 8px 0;
}


/* ══════════════════════════════════════════════
   SPECIALIST DASHBOARD — NEW STYLES
   ══════════════════════════════════════════════ */

/* Dashboard avatar + name clickable area */
.dash-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    flex: 1;
}

.dash-profile-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Dashboard circle avatar */
.dash-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 12px rgba(135, 116, 225, 0.4);
}

/* Online/Offline toggle button */
.online-toggle-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.online-toggle-btn:hover {
    background: var(--glass-hover);
    border-color: var(--green);
    color: var(--green);
}

.online-toggle-btn.is-online {
    background: rgba(91, 182, 121, 0.15);
    border-color: var(--green);
    color: var(--green);
    box-shadow: 0 0 12px rgba(91, 182, 121, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px;
    text-align: center;
    gap: 6px;
    border-radius: var(--radius-lg);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon.purple {
    background: var(--gradient-main);
}

.stat-icon.teal {
    background: var(--gradient-teal);
}

.stat-icon.gold {
    background: var(--gradient-gold);
    color: #333;
}

.stat-icon .material-symbols-rounded {
    font-size: 20px;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

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


/* ══════════════════════════════════════════════
   PROFILE SCREEN
   ══════════════════════════════════════════════ */

.screen-header {
    flex-shrink: 0;
}

.screen-header .header-action-btn {
    margin-left: auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.screen-header .header-action-btn:hover {
    background: var(--glass-hover);
    border-color: var(--purple);
}

/* Profile Hero Card */
.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px 24px;
    text-align: center;
    margin-bottom: 12px;
}

.profile-photo-wrap {
    margin-bottom: 16px;
}

.profile-photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 24px rgba(135, 116, 225, 0.4);
    color: white;
}

.profile-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-spec {
    font-size: 14px;
    color: var(--purple-light);
    font-weight: 500;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.profile-badge.gold {
    background: rgba(244, 197, 66, 0.12);
    border-color: rgba(244, 197, 66, 0.3);
    color: var(--gold);
}

/* Profile Info List */
.profile-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-info-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
}

.profile-info-icon {
    font-size: 22px !important;
    flex-shrink: 0;
    margin-top: 2px;
}

.profile-info-content {
    flex: 1;
    min-width: 0;
}

.profile-info-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
    font-weight: 500;
}

.profile-info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
    word-break: break-word;
}


/* ══════════════════════════════════════════════
   PROFILE EDIT SCREEN
   ══════════════════════════════════════════════ */

/* Photo Upload area */
.edit-photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.edit-photo-wrap {
    position: relative;
    cursor: pointer;
    width: 100px;
    height: 100px;
}

.edit-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.18);
    color: white;
    transition: var(--transition);
}

.edit-photo-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    color: white;
    gap: 2px;
}

.edit-photo-overlay .material-symbols-rounded {
    font-size: 26px;
}

.edit-photo-wrap:hover .edit-photo-overlay {
    opacity: 1;
}

/* Profile Edit Form Card */
.profile-edit-form {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.edit-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.edit-section-title .material-symbols-rounded {
    font-size: 20px;
    color: var(--purple-light);
}#specialistDetailOverlay, #specialistDetailOverlay *, #specialistDetailOverlay .tinder-desc { color: #ffffff !important; }
