/**
 * SOHBETODA - Video Konferans Stili
 */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #1e293b;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-light: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text);
}

.btn-secondary:hover {
    background: #475569;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--text);
}

/* Small buttons (waiting list) */
.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    color: white;
}

.btn-sm.btn-success {
    background: var(--success);
}

.btn-sm.btn-success:hover {
    background: #16a34a;
}

.btn-sm.btn-danger {
    background: var(--danger);
}

.btn-sm.btn-danger:hover {
    background: #dc2626;
}

/* Landing Page */
.landing-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e1b4b 100%);
}

.landing-content {
    text-align: center;
    max-width: 500px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 48px;
    color: var(--primary);
}

.logo h1 {
    font-size: 42px;
    font-weight: 800;
    color: var(--text);
}

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

.tagline {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.actions {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.actions .btn-primary {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--text-muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 15px;
    font-size: 14px;
}

.join-form {
    display: flex;
    gap: 10px;
}

.join-form input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.join-form input:focus {
    border-color: var(--primary);
}

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

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 40px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-muted);
}

.feature i {
    color: var(--primary);
    font-size: 16px;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
}

.modal-content h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.modal-content h2 i {
    color: var(--primary);
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

.modal-content input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
    color: var(--text);
    font-size: 16px;
    text-align: center;
    margin-bottom: 20px;
    outline: none;
}

.modal-content input:focus {
    border-color: var(--primary);
}

.modal-content .btn {
    width: 100%;
    padding: 14px;
}

/* ==================== LOBBY OVERLAY ==================== */
.lobby-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}

.lobby-content {
    text-align: center;
    max-width: 400px;
}

.lobby-content h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 24px;
}

.lobby-content h2 i {
    color: var(--warning);
}

.lobby-content p {
    color: var(--text-muted);
    margin-bottom: 10px;
}

.lobby-position {
    font-size: 18px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 30px !important;
}

.lobby-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 25px;
    animation: spin 1s linear infinite;
}

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

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast-info {
    background: var(--primary);
}

.toast-success {
    background: var(--success);
}

.toast-warning {
    background: var(--warning);
    color: #1e293b;
}

.toast-error {
    background: var(--danger);
}

.toast-fade-out {
    animation: toastOut 0.3s ease forwards;
}

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

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

/* ==================== LOBBY TOAST BİLDİRİM ==================== */
.toast-lobby {
    background: var(--bg-card) !important;
    border: 2px solid var(--primary);
    padding: 0 !important;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

.lobby-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    flex-wrap: wrap;
}

.lobby-toast-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.lobby-toast-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lobby-toast-info strong {
    color: var(--text);
    font-size: 14px;
}

.lobby-toast-info span {
    color: var(--text-muted);
    font-size: 12px;
}

.lobby-toast-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.lobby-toast-actions .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Badge pulse animasyonu */
.badge-pulse {
    animation: badgePulse 0.5s ease 3;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

/* ==================== CONNECTION QUALITY ==================== */
.connection-quality {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.quality-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.quality-dot.good { background: var(--success); }
.quality-dot.medium { background: var(--warning); }
.quality-dot.poor { background: var(--danger); }
.quality-dot.disconnected { background: var(--text-muted); }

/* ==================== TYPING INDICATOR ==================== */
.typing-indicator {
    padding: 4px 15px 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.typing-indicator::after {
    content: '';
    animation: typingDots 1.5s infinite;
}

@keyframes typingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ==================== DEVICE SELECTOR MODAL ==================== */
.device-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.device-modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow);
}

.device-modal h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
}

.device-modal h3 i {
    color: var(--primary);
}

.device-group {
    margin-bottom: 16px;
}

.device-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.device-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
    color: var(--text);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.device-group select:focus {
    border-color: var(--primary);
}

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

/* ==================== AVATAR COLORS ==================== */
.avatar-color-0 { background: #6366f1 !important; }
.avatar-color-1 { background: #ec4899 !important; }
.avatar-color-2 { background: #14b8a6 !important; }
.avatar-color-3 { background: #f59e0b !important; }
.avatar-color-4 { background: #8b5cf6 !important; }
.avatar-color-5 { background: #06b6d4 !important; }
.avatar-color-6 { background: #ef4444 !important; }
.avatar-color-7 { background: #22c55e !important; }

/* ==================== RECONNECTION BANNER ==================== */
.reconnect-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: var(--warning);
    color: #1e293b;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.reconnect-banner i {
    animation: spin 1s linear infinite;
}

/* ==================== REACTION CONTAINER ==================== */
.reaction-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1500;
    overflow: hidden;
}

.floating-emoji {
    position: absolute;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: floatUp 3s ease-out forwards;
}

.emoji-large {
    font-size: 48px;
}

.emoji-sender {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-300px) scale(0.5);
    }
}

/* Room Page */
.room-page {
    height: 100vh;
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.room-container {
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr 320px;
    height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Room Header */
.room-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.room-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.room-info h1 {
    font-size: 20px;
    font-weight: 700;
}

.room-info h1 span {
    color: var(--primary);
}

.room-code {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 14px;
}

.room-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.participant-count {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

/* Meeting Timer */
.meeting-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 14px;
    color: var(--success);
}

.meeting-timer i {
    font-size: 12px;
}

/* Waiting Button */
.waiting-btn {
    position: relative;
    font-size: 18px;
    color: var(--warning);
}

.waiting-btn:hover {
    color: var(--text);
}

.waiting-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    font-size: 20px;
}

/* Video Grid */
.room-main {
    padding: 20px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    flex: 1;
}

.video-item {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

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

.video-item.local video {
    transform: scaleX(-1);
}

.video-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-label span {
    font-weight: 600;
    font-size: 14px;
}

.video-status {
    display: flex;
    gap: 10px;
}

.video-status i {
    font-size: 12px;
    color: var(--success);
}

.video-status i.muted {
    color: var(--danger);
}

/* Hand Raise Icon */
.hand-raise-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--warning);
    color: #1e293b;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    animation: handPulse 1.5s ease-in-out infinite;
    z-index: 5;
}

@keyframes handPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ==================== KONUŞMACI VURGUSU ==================== */
.video-item.speaking {
    box-shadow: 0 0 0 3px var(--success), 0 0 20px rgba(34, 197, 94, 0.3);
    z-index: 2;
}

/* ==================== SPEAKER VIEW ==================== */
.video-grid.speaker-view {
    grid-template-columns: 1fr;
}

.video-grid.speaker-view .video-item {
    display: none;
}

.video-grid.speaker-view .video-item.speaker-active {
    display: block;
    aspect-ratio: auto;
    height: 100%;
}

.thumbnail-strip {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    overflow-x: auto;
    flex-shrink: 0;
}

.thumb-item {
    width: 150px;
    height: 85px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.thumb-item:hover {
    border-color: var(--primary);
}

.thumb-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Chat Sidebar */
.chat-sidebar {
    grid-row: 2 / 4;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.chat-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.chat-header h3 i {
    color: var(--primary);
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 85%;
}

.chat-message.own {
    align-self: flex-end;
}

.chat-message .sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.chat-message.own .sender {
    text-align: right;
}

.chat-message .text {
    padding: 10px 14px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.own .text {
    background: var(--primary);
}

.chat-message.system {
    align-self: center;
    max-width: 100%;
}

.chat-message.system .text {
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

/* File message */
.file-message {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-message i {
    color: var(--primary);
    font-size: 16px;
}

.file-message a {
    color: var(--text);
    text-decoration: underline;
    word-break: break-all;
}

.file-message a:hover {
    color: var(--primary);
}

.file-size {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

/* Chat Input */
.chat-input {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid var(--border);
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.chat-input button {
    color: var(--primary);
    font-size: 18px;
}

/* File Upload Button */
.file-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
    padding: 4px;
    transition: color 0.2s;
}

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

/* Room Controls */
.room-controls {
    grid-column: 1 / 2;
    display: flex;
    justify-content: center;
    padding: 15px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.controls-center {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.control-btn:hover {
    background: #475569;
    transform: scale(1.05);
}

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

.control-btn.muted {
    background: var(--danger);
}

.control-btn.danger {
    background: var(--danger);
}

.control-btn.danger:hover {
    background: #dc2626;
}

.control-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ==================== EMOJI PICKER ==================== */
.emoji-picker {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 200;
}

.emoji-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    background: var(--bg-light);
    transform: scale(1.2);
}

/* Participants Sidebar */
.participants-sidebar {
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 80px;
    width: 280px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 100;
    overflow-y: auto;
}

.participants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.participants-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.participants-list {
    padding: 15px;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.participant-item:hover {
    background: var(--bg-light);
}

.participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

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

.participant-name {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.participant-status {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.participant-status i {
    font-size: 11px;
    color: var(--success);
}

.participant-status i.muted {
    color: var(--danger);
}

/* Host Badge */
.host-badge {
    background: var(--warning);
    color: #1e293b;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* Kick Button */
.kick-btn {
    color: var(--danger) !important;
    font-size: 14px;
    flex-shrink: 0;
}

.kick-btn:hover {
    color: #dc2626 !important;
}

/* ==================== WAITING SIDEBAR ==================== */
.waiting-sidebar {
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 80px;
    width: 300px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 100;
    overflow-y: auto;
}

.waiting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.waiting-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: var(--warning);
}

.waiting-list {
    padding: 15px;
}

.empty-waiting {
    color: var(--text-muted);
    text-align: center;
    font-size: 14px;
    padding: 20px;
}

.waiting-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--bg-dark);
}

.waiting-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--warning);
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.waiting-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.waiting-actions {
    display: flex;
    gap: 6px;
}

/* ==================== MOBILE OVERLAY MENU ==================== */
.mobile-overlay-menu {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
}

.mobile-menu-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 18px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-menu-item:hover {
    background: #475569;
}

.mobile-menu-item i {
    font-size: 18px;
    color: var(--primary);
    width: 24px;
    text-align: center;
}

/* ==================== RESPONSIVE ==================== */

/* Touch-friendly global */
@media (pointer: coarse) {
    .btn, .btn-icon, .btn-sm, .control-btn, .emoji-btn, .mobile-menu-item {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ===== 768px: Tablet ve altı ===== */
@media (max-width: 768px) {

    /* --- GENEL TAŞMA ENGELİ --- */
    html, body, .room-page {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* --- LAYOUT: Tek sütun, sidebar grid dışı --- */
    .room-container {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto 1fr auto;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .room-controls {
        grid-column: 1 / -1;
    }

    .room-header {
        grid-column: 1 / -1;
    }

    .room-main {
        grid-column: 1 / -1;
    }

    /* --- HEADER --- */
    .room-header {
        padding: 8px 10px;
    }

    .room-info {
        gap: 8px;
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .room-info h1 {
        font-size: 15px;
        white-space: nowrap;
    }

    .room-info h1 i {
        display: none;
    }

    .room-code {
        display: none;
    }

    .meeting-timer {
        font-size: 11px;
        padding: 4px 8px;
        gap: 4px;
    }

    .room-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    /* Ayrıl: sadece ikon */
    #leaveBtn .btn-text {
        display: none;
    }

    #leaveBtn {
        padding: 8px 10px;
        font-size: 14px;
        min-width: 44px;
        min-height: 44px;
        gap: 0;
    }

    .participant-count {
        font-size: 13px;
    }

    /* Hamburger menü göster */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        font-size: 20px;
    }

    /* --- VIDEO GRID: 2 sütun --- */
    .room-main {
        padding: 6px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px;
    }

    .video-item {
        aspect-ratio: 4 / 3;
        min-height: 0;
    }

    .video-label {
        padding: 6px 8px;
    }

    .video-label span {
        font-size: 11px;
    }

    .video-status i {
        font-size: 10px;
    }

    .hand-raise-icon {
        width: 26px;
        height: 26px;
        font-size: 13px;
        top: 6px;
        right: 6px;
    }

    /* --- SIDEBAR'LAR: Tam ekran fixed overlay --- */
    .chat-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 900 !important;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        grid-row: auto !important;
        grid-column: auto !important;
        border-left: none !important;
    }

    .chat-sidebar.active {
        transform: translateX(0);
    }

    .participants-sidebar,
    .waiting-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 900 !important;
        border-left: none !important;
    }

    /* --- KONTROL BUTONLARI: Mobilde gereksizleri gizle --- */
    /* Sohbet + Katılımcılar + Ekran paylaş: hamburger menüden erişilir */
    #showChat,
    #showParticipants,
    #toggleScreen {
        display: none !important;
    }

    /* Kalan butonlar: mic, cam, el, tepki, görünüm, [muteAll], endCall = max 7 */
    /* 7 × 44px + 6 × 6px = 344px → 375px iPhone'a sığar */
    .control-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
        flex-shrink: 0;
    }

    .controls-center {
        gap: 6px;
        width: 100%;
        max-width: 100%;
        justify-content: center;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 0 4px;
    }

    .room-controls {
        padding: 10px 6px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        width: 100%;
        overflow: hidden;
    }

    /* --- EMOJI PICKER --- */
    .emoji-picker {
        bottom: 80px;
        padding: 10px;
        gap: 6px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        transform: none;
        justify-content: space-around;
    }

    .emoji-btn {
        width: 44px;
        height: 44px;
        font-size: 24px;
        flex-shrink: 0;
    }

    /* --- THUMBNAIL STRIP --- */
    .thumbnail-strip {
        padding: 6px 0;
    }

    .thumb-item {
        width: 100px;
        height: 56px;
    }

    /* --- TOAST --- */
    .toast-container {
        top: auto;
        bottom: 80px;
        right: 10px;
        left: 10px;
    }

    .toast {
        font-size: 13px;
        padding: 10px 14px;
    }

    /* --- LANDING PAGE --- */
    .features {
        grid-template-columns: 1fr;
    }

    .join-form {
        flex-direction: column;
    }

    .join-form .btn-primary {
        width: 100%;
    }

    .logo i {
        font-size: 36px;
    }

    .logo h1 {
        font-size: 32px;
    }

    .tagline {
        font-size: 15px;
        margin-bottom: 25px;
    }

    .landing-container {
        padding: 15px;
    }

    .actions {
        padding: 20px;
    }

    /* --- MODAL --- */
    .modal {
        padding: 15px;
    }

    .modal-content {
        padding: 25px 20px;
        max-width: 100%;
    }

    /* --- LOBBY --- */
    .lobby-overlay {
        padding: 15px;
    }

    .lobby-content {
        padding: 0 10px;
    }

    .lobby-content h2 {
        font-size: 20px;
    }

    .lobby-spinner {
        width: 50px;
        height: 50px;
    }

    /* --- MOBILE OVERLAY MENU --- */
    .mobile-overlay-menu {
        z-index: 950;
    }

    /* --- CONNECTION QUALITY: hide on mobile --- */
    .connection-quality {
        display: none;
    }

    /* --- DEVICE MODAL --- */
    .device-modal {
        max-width: 100%;
        margin: 10px;
    }
}

/* ===== 480px: Telefon ===== */
@media (max-width: 480px) {
    /* Tek sütun video */
    .video-grid {
        grid-template-columns: 1fr !important;
        gap: 4px;
    }

    .video-item {
        aspect-ratio: 16 / 9;
    }

    /* Header daha sıkı */
    .room-header {
        padding: 6px 8px;
    }

    .room-info {
        gap: 6px;
    }

    .room-info h1 {
        font-size: 14px;
    }

    .meeting-timer {
        font-size: 10px;
        padding: 3px 6px;
    }

    .room-actions {
        gap: 6px;
    }

    #leaveBtn {
        padding: 6px 8px;
        font-size: 13px;
        min-width: 40px;
        min-height: 40px;
    }

    .participant-count {
        font-size: 12px;
        gap: 4px;
    }

    /* Kontrol butonları küçült */
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .controls-center {
        gap: 5px;
    }

    .room-controls {
        padding: 8px 4px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    /* Emoji picker */
    .emoji-picker {
        bottom: 65px;
        gap: 4px;
        padding: 8px;
        left: 6px;
        right: 6px;
    }

    .emoji-btn {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    /* Thumbnail strip küçük */
    .thumb-item {
        width: 80px;
        height: 45px;
    }

    /* Chat input */
    .chat-input {
        padding: 10px;
        gap: 6px;
    }

    .chat-input input {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Floating emoji küçült */
    .emoji-large {
        font-size: 36px;
    }

    /* Lobby */
    .lobby-content h2 {
        font-size: 18px;
    }

    .lobby-position {
        font-size: 16px;
    }

    .lobby-spinner {
        width: 40px;
        height: 40px;
    }

    /* Waiting items */
    .waiting-item {
        padding: 8px;
        gap: 8px;
    }

    .waiting-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    /* Participant items */
    .participant-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .participant-name {
        font-size: 13px;
    }

    .participant-item {
        padding: 8px;
        gap: 8px;
    }

    /* Mobile menu */
    .mobile-menu-content {
        width: 260px;
        padding: 25px 20px;
    }

    /* Room main */
    .room-main {
        padding: 4px;
    }

    /* Typing indicator */
    .typing-indicator {
        font-size: 11px;
        padding: 2px 10px 6px;
    }
}

/* ===== 360px: Küçük telefon ===== */
@media (max-width: 360px) {
    .room-info h1 span {
        display: none;
    }

    .meeting-timer {
        font-size: 9px;
        padding: 2px 5px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .controls-center {
        gap: 4px;
    }

    .emoji-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    #leaveBtn {
        min-width: 36px;
        min-height: 36px;
        padding: 4px 6px;
    }
}

/* ===== Landscape telefon ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .room-header {
        padding: 4px 10px;
    }

    .room-main {
        padding: 4px;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 4px;
    }

    .video-item {
        aspect-ratio: 16 / 9;
    }

    .room-controls {
        padding: 4px 6px;
    }

    .control-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .controls-center {
        gap: 4px;
    }
}

/* ===== Safe area (notch) desteği ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .room-controls {
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
    }

    .room-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }

    @media (max-width: 768px) {
        .room-controls {
            padding-bottom: calc(10px + env(safe-area-inset-bottom));
        }

        .room-header {
            padding-top: calc(8px + env(safe-area-inset-top));
        }

        .chat-sidebar,
        .participants-sidebar,
        .waiting-sidebar {
            padding-top: env(safe-area-inset-top);
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}
