/* ============================================
سیستم تماس تصویری - نسخه 5.0 (Ultra Premium)
طراحی لوکس، مینیمال و فوق‌العاده شیک
============================================ */

/* ---------- متغیرهای اصلی ---------- */
:root {
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --pink-400: #f472b6;
    --pink-500: #ec4899;
    --pink-600: #db2777;
    --purple-500: #a855f7;
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0a0e27;
    --bg-darker: #050814;
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dim: rgba(255, 255, 255, 0.35);
    --radius: 20px;
    --radius-sm: 12px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 60px rgba(59, 130, 246, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- ریست و پایه ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    direction: rtl;
    overflow: hidden;
    height: 100%;
    width: 100%;
    position: fixed;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
    color: inherit;
}

svg {
    display: block;
    flex-shrink: 0;
}

/* ============================================
پس‌زمینه متحرک Premium
============================================ */
.bg-animation {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: blobFloat 25s ease-in-out infinite;
    will-change: transform;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--blue-500) 0%, transparent 70%);
    top: -15%;
    right: -15%;
    animation-delay: 0s;
}

.blob-2 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--pink-500) 0%, transparent 70%);
    bottom: -20%;
    left: -20%;
    animation-delay: -8s;
}

.blob-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--purple-500) 0%, transparent 70%);
    top: 40%;
    left: 40%;
    animation-delay: -16s;
}

.blob-4 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--blue-400) 0%, transparent 70%);
    bottom: 30%;
    right: 10%;
    animation-delay: -12s;
    opacity: 0.3;
}

@keyframes blobFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(80px, -60px) scale(1.15);
    }
    50% {
        transform: translate(-60px, 80px) scale(0.9);
    }
    75% {
        transform: translate(-80px, -40px) scale(1.1);
    }
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

#particlesCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

/* ============================================
صفحات
============================================ */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
    animation: screenFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
صفحه ورود (Join Screen)
============================================ */
#joinScreen {
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.join-container {
    width: 100%;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ---------- برند ---------- */
.brand {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.brand-icon {
    width: 96px;
    height: 96px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(236, 72, 153, 0.15));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(59, 130, 246, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 0 80px rgba(236, 72, 153, 0.15);
    animation: iconPulse 4s ease-in-out infinite;
}

.brand-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--blue-500), var(--pink-500), var(--purple-500));
    opacity: 0.4;
    z-index: -1;
    filter: blur(20px);
    animation: glowRotate 8s linear infinite;
}

@keyframes glowRotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
}

.brand-pulse {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    border: 2px solid rgba(96, 165, 250, 0.3);
    animation: pulseRing 2.5s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.brand-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 12px rgba(96, 165, 250, 0.4));
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 20px 60px rgba(59, 130, 246, 0.25),
            0 0 0 1px rgba(255, 255, 255, 0.08) inset,
            0 0 80px rgba(236, 72, 153, 0.15);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            0 25px 70px rgba(236, 72, 153, 0.35),
            0 0 0 1px rgba(255, 255, 255, 0.15) inset,
            0 0 100px rgba(59, 130, 246, 0.25);
    }
}

.brand h1 {
    font-size: 40px;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa 0%, #f472b6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    line-height: 1.2;
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tagline {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* ---------- کارت ورود ---------- */
.join-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 100px rgba(59, 130, 246, 0.08);
}

.join-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.join-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* ---------- دکمه‌ها ---------- */
.btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    overflow: hidden;
    isolation: isolate;
    white-space: nowrap;
    z-index: 1;
}

.btn-lg {
    padding: 22px 28px;
    font-size: 16px;
}

.btn-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.btn-icon-wrap svg {
    width: 22px;
    height: 22px;
}

.btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    flex: 1;
    text-align: right;
}

.btn-text strong {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}

.btn-text small {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.85;
}

.btn-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: translateX(-100%);
    transition: transform 0.7s ease;
    pointer-events: none;
    z-index: -1;
}

.btn:hover .btn-glow {
    transform: translateX(100%);
}

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.btn:hover .btn-arrow {
    transform: translateX(-4px);
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue-500) 0%, var(--pink-500) 100%);
    color: white;
    box-shadow: 
        0 10px 30px rgba(59, 130, 246, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 40px rgba(236, 72, 153, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--blue-600) 0%, var(--pink-600) 100%);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
    border-radius: inherit;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 20px 50px rgba(236, 72, 153, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 0 60px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover::before {
    opacity: 1;
}

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

.btn-primary .btn-icon-wrap {
    background: rgba(255, 255, 255, 0.25);
}

/* ---------- جداکننده ---------- */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

/* ---------- بخش ورود به اتاق ---------- */
.join-room-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.input-label svg {
    width: 16px;
    height: 16px;
    color: var(--primary-light);
}

.join-room {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 6px;
    transition: var(--transition);
    position: relative;
}

.join-room::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.join-room:focus-within {
    border-color: transparent;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: rgba(0, 0, 0, 0.35);
}

.join-room:focus-within::before {
    opacity: 1;
}

.join-room input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    direction: ltr;
    text-align: center;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    color: var(--text);
    min-width: 0;
    font-weight: 600;
}

.join-room input::placeholder {
    color: var(--text-dim);
    letter-spacing: 0;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 13px;
    font-weight: 400;
}

.btn-join {
    padding: 12px 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue-500), var(--pink-500));
    color: white;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    white-space: nowrap;
}

.btn-join svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.btn-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4);
}

.btn-join:hover svg {
    transform: translateX(-3px);
}

/* ---------- ویژگی‌ها ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    transition: var(--transition);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(236, 72, 153, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
}

.feature-icon svg {
    width: 18px;
    height: 18px;
}

.feature-item span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ---------- فوتر ---------- */
.join-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
}

.heart-icon {
    width: 16px;
    height: 16px;
    color: var(--pink-500);
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.15); }
}

/* ============================================
صفحه تماس (Call Screen)
============================================ */
#callScreen {
    flex-direction: column;
    background: #000;
}

.call-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ---------- کانتینر ویدیو ---------- */
.video-container {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #0a0e27, #1a1f3a);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* ---------- حالت انتظار ---------- */
.waiting-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.95), rgba(26, 31, 58, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.waiting-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.waiting-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 20px;
    max-width: 400px;
    animation: slideUp 0.6s ease-out;
}

.waiting-avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(236, 72, 153, 0.2));
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    position: relative;
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.2);
}

.waiting-avatar svg {
    width: 64px;
    height: 64px;
    stroke-width: 1.5;
}

.status-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: spin 2.5s linear infinite;
}

.status-ring:first-of-type {
    inset: -10px;
    border-top-color: var(--blue-400);
    border-right-color: var(--pink-400);
}

.status-ring:last-of-type {
    inset: -20px;
    border-top-color: var(--pink-400);
    border-right-color: var(--blue-400);
    animation-duration: 3.5s;
    animation-direction: reverse;
}

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

.waiting-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.waiting-text h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.waiting-text p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.waiting-room-id {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.room-id-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.room-id-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.room-id-box code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-light);
    letter-spacing: 1.5px;
    direction: ltr;
}

.copy-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.copy-btn:hover {
    background: linear-gradient(135deg, var(--blue-500), var(--pink-500));
    color: white;
    transform: scale(1.1);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

.waiting-dots {
    display: flex;
    gap: 10px;
}

.waiting-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-400), var(--pink-400));
    animation: dotBounce 1.4s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.5);
}

.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-18px);
        opacity: 1;
    }
}

/* ---------- ویدیوی محلی ---------- */
.local-video {
    position: absolute;
    bottom: 120px;
    right: 20px;
    width: 160px;
    height: 220px;
    object-fit: cover;
    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #0a0e27, #1a1f3a);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 4;
    transition: var(--transition);
    cursor: pointer;
    transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
}

.local-video:hover {
    transform: scaleX(-1) scale(1.05);
    border-color: var(--primary-light);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(96, 165, 250, 0.3);
}

.video-label {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text);
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.local-label {
    bottom: 295px;
    right: 20px;
}

/* ---------- هدر تماس ---------- */
.call-header-overlay {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 10;
    transition: opacity 0.5s ease, transform 0.5s ease;
    width: auto;
    max-width: 90%;
}

.call-header-overlay.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    pointer-events: none;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 18px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    flex-shrink: 0;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 currentColor; }
    50% { box-shadow: 0 0 0 6px transparent; }
}

.status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

.status-dot.disconnected {
    background: var(--danger);
}

.status-text {
    color: var(--text-secondary);
    font-size: 12px;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 6px 14px 6px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: var(--text-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.room-info svg {
    color: var(--primary-light);
    width: 12px;
    height: 12px;
}

.room-info strong {
    color: var(--primary-light);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.5px;
    font-weight: 600;
    direction: ltr;
}

.room-info span {
    font-size: 11px;
}

/* ---------- کنترل‌ها ---------- */
.controls-overlay {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.controls-overlay.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    padding: 14px 22px;
    border-radius: 60px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.control-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.control-btn:active {
    transform: scale(0.92);
}

.control-btn .icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.control-btn .tooltip {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 11px;
    color: var(--text);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-btn:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.control-btn.muted {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.end-call {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: rgba(239, 68, 68, 0.5);
    color: white;
    width: 56px;
    height: 56px;
    box-shadow: 
        0 4px 20px rgba(239, 68, 68, 0.4),
        0 0 30px rgba(239, 68, 68, 0.2);
    animation: endCallPulse 3s ease-in-out infinite;
}

@keyframes endCallPulse {
    0%, 100% {
        box-shadow: 
            0 4px 20px rgba(239, 68, 68, 0.4),
            0 0 30px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 
            0 4px 25px rgba(239, 68, 68, 0.5),
            0 0 40px rgba(239, 68, 68, 0.3);
    }
}

.end-call:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: scale(1.1);
    box-shadow: 
        0 8px 30px rgba(239, 68, 68, 0.5),
        0 0 50px rgba(239, 68, 68, 0.3);
}

.end-call .icon svg {
    width: 24px;
    height: 24px;
}

/* ---------- نوتیفیکیشن ---------- */
.notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(20, 20, 40, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 14px 28px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    text-align: center;
    max-width: 90%;
    z-index: 1000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    letter-spacing: 0.3px;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification.success {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.25);
    color: #a7f3d0 !important;
    box-shadow: 0 20px 50px rgba(16, 185, 129, 0.25);
}

.notification.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5 !important;
    box-shadow: 0 20px 50px rgba(239, 68, 68, 0.25);
}

.notification.info {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd !important;
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.2);
}

.notification.warning {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d !important;
    box-shadow: 0 20px 50px rgba(245, 158, 11, 0.2);
}

/* ============================================
ریسپانسیو
============================================ */
@media (max-width: 768px) {
    .brand h1 { font-size: 32px; }
    .brand-icon { width: 80px; height: 80px; padding: 18px; border-radius: 22px; }
    .join-card { padding: 28px; gap: 20px; border-radius: 28px; }
    .btn-lg { padding: 18px 24px; font-size: 15px; }
    .btn-icon-wrap { width: 40px; height: 40px; }
    .btn-icon-wrap svg { width: 20px; height: 20px; }
    .btn-text strong { font-size: 15px; }
    
    .local-video {
        width: 110px;
        height: 150px;
        bottom: 20px;
        right: 12px;
        border-radius: 14px;
    }
    .local-label { bottom: 170px; right: 12px; font-size: 10px; }
    
    .controls { gap: 10px; padding: 10px 16px; }
    .control-btn { width: 44px; height: 44px; }
    .control-btn .icon svg { width: 19px; height: 19px; }
    .end-call { width: 48px; height: 48px; }
    .end-call .icon svg { width: 21px; height: 21px; }
    .controls-overlay { bottom: 24px; }
    .control-btn .tooltip { display: none; }
    
    .waiting-avatar { width: 100px; height: 100px; }
    .waiting-avatar svg { width: 50px; height: 50px; }
    .waiting-text h3 { font-size: 16px; }
    .waiting-text p { font-size: 13px; }
    .room-id-box code { font-size: 14px; }
    
    .features { gap: 8px; }
    .feature-item { padding: 12px 6px; }
    .feature-icon { width: 32px; height: 32px; }
    .feature-icon svg { width: 16px; height: 16px; }
    .feature-item span { font-size: 10px; }
    
    .notification { bottom: 80px; padding: 12px 22px; font-size: 13px; }
}

@media (max-width: 480px) {
    .brand h1 { font-size: 28px; }
    .tagline { font-size: 13px; }
    .join-card { padding: 22px; }
    .btn-lg { padding: 16px 20px; }
    .btn-text strong { font-size: 14px; }
    .btn-text small { font-size: 11px; }
    
    .local-video { width: 90px; height: 125px; bottom: 18px; right: 10px; }
    .local-label { bottom: 143px; right: 10px; font-size: 9px; padding: 3px 8px; }
    
    .controls { gap: 8px; padding: 8px 14px; }
    .control-btn { width: 38px; height: 38px; }
    .control-btn .icon svg { width: 16px; height: 16px; }
    .end-call { width: 42px; height: 42px; }
    .end-call .icon svg { width: 18px; height: 18px; }
    .controls-overlay { bottom: 18px; }
    
    .waiting-content { gap: 20px; }
    .waiting-avatar { width: 85px; height: 85px; }
    .waiting-avatar svg { width: 42px; height: 42px; }
    .waiting-text h3 { font-size: 15px; }
    .room-id-box { padding: 8px 12px; }
    .room-id-box code { font-size: 13px; }
}

@media (max-width: 360px) {
    .brand h1 { font-size: 24px; }
    .local-video { width: 80px; height: 110px; }
    .local-label { bottom: 128px; }
    .control-btn { width: 34px; height: 34px; }
    .control-btn .icon svg { width: 14px; height: 14px; }
    .end-call { width: 38px; height: 38px; }
    .controls { gap: 6px; padding: 6px 10px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .local-video { width: 80px; height: 110px; bottom: 80px; right: 12px; }
    .local-label { bottom: 190px; right: 12px; }
    .controls { padding: 8px 14px; gap: 8px; }
    .control-btn { width: 38px; height: 38px; }
    .end-call { width: 42px; height: 42px; }
    .controls-overlay { bottom: 16px; }
    .waiting-avatar { width: 80px; height: 80px; }
}

@media (min-width: 1025px) {
    .brand h1 { font-size: 44px; }
    .join-card { padding: 40px; }
    .local-video { width: 200px; height: 270px; bottom: 140px; right: 24px; border-radius: 20px; }
    .local-label { bottom: 365px; right: 24px; }
    .controls { gap: 18px; padding: 16px 28px; }
    .control-btn { width: 58px; height: 58px; }
    .control-btn .icon svg { width: 24px; height: 24px; }
    .end-call { width: 64px; height: 64px; }
    .end-call .icon svg { width: 28px; height: 28px; }
}

/* ---------- Light Mode ---------- */
@media (prefers-color-scheme: light) {
    :root {
        --bg-dark: #f0f4ff;
        --text: #1a1f3a;
        --text-secondary: rgba(26, 31, 58, 0.75);
        --text-muted: rgba(26, 31, 58, 0.5);
        --text-dim: rgba(26, 31, 58, 0.35);
    }
    
    .bg-blob { opacity: 0.25; }
    .join-card {
        background: rgba(255, 255, 255, 0.75);
        border-color: rgba(59, 130, 246, 0.15);
    }
    .join-room { background: rgba(255, 255, 255, 0.6); border-color: rgba(59, 130, 246, 0.2); }
    .connection-status, .room-info {
        background: rgba(255, 255, 255, 0.85);
        border-color: rgba(0, 0, 0, 0.08);
        color: var(--text);
    }
    .controls {
        background: rgba(255, 255, 255, 0.85);
        border-color: rgba(0, 0, 0, 0.08);
    }
    .control-btn {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.08);
        color: var(--text);
    }
    .control-btn:hover { background: rgba(0, 0, 0, 0.1); }
    .waiting-overlay {
        background: linear-gradient(135deg, rgba(240, 244, 255, 0.95), rgba(230, 236, 255, 0.95));
    }
    .video-label {
        background: rgba(255, 255, 255, 0.85);
        color: var(--text);
        border-color: rgba(0, 0, 0, 0.08);
    }
    .local-video { border-color: rgba(0, 0, 0, 0.12); }
    .feature-item {
        background: rgba(255, 255, 255, 0.5);
        border-color: rgba(59, 130, 246, 0.1);
    }
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .bg-blob { animation: none; }
}