body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    /* Soft soothing gradient instead of pitch black */
    background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
    color: #1c1c1e;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100dvh;
    overflow: hidden;
}

button {
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.1s ease;
    user-select: none;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

button:active:not(:disabled) {
    transform: scale(0.96);
}

/* ✅ Main Setup Box ko bada aur responsive banaya */

/* ✅ Box ko vertically lamba aur scrollable banaya */
.peer-setup-box {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 30px 20px;
    border-radius: 24px;
    margin: 15px auto;
    width: calc(100% - 30px); /* Side se halka margin */
    max-width: 400px;
    
    /* 👇 YAHAN SE MAGIC HOGA 👇 */
    height: 92dvh; /* Screen ki 92% height cover karega */
    display: flex;
    flex-direction: column; /* Andar ke items ko line me lagane ke liye */
    overflow-y: auto; /* Agar online users ki list lambi ho jaye, toh isi dabbe ke andar scroll hoga */
    
    box-sizing: border-box;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
x
/* ✅ Input field ko bada kiya */
.peer-setup-box input {
    width: 100%; /* Pura width lega */
    box-sizing: border-box;
    padding: 14px;
    margin: 15px 0;
    border-radius: 12px;
    text-align: center;
    font-size: 16px;
    border: 1px solid #007aff;
    background: #f2f2f7;
    color: #1c1c1e;
}

/* ✅ "Call Karein" Button ko full width kiya */
.peer-setup-box button {
    width: 100%; /* Button bhi pura lamba ho jayega */
    box-sizing: border-box;
    padding: 14px 20px;
    font-weight: bold;
    border-radius: 12px;
    font-size: 16px;
    background: #007aff;
    color: #ffffff;
    margin-top: 5px;
}
 

.call-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 15, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.call-card {
    width: 340px;
    height: 560px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 28px;
    padding: 30px 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.1),
                inset 0 1px 2px rgba(255, 255, 255, 0.5);
    color: #1c1c1e;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

/* Remote Large Video (Background) */
#webcamVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    border-radius: 28px;
    background: #000;
}

/* ✅ Local Self Preview Floating Card Video */
#localVideoPreview {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 90px;
    height: 130px;
    object-fit: cover;
    z-index: 3;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: #111;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.mirror { transform: scaleX(-1); }

.card-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.avatar-container {
    width: 120px;
    height: 120px;
    margin: 10px auto;
    position: relative;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.call-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 55px;
}

.call-time-bar {
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    width: fit-content;
    letter-spacing: 1px;
    transition: opacity 0.4s ease;
}

.call-title {
    font-size: 24px;
    margin-top: 10px;
    font-weight: bold;
    transition: opacity 0.4s ease;
}

.call-status {
    color: #a0aec0;
    margin-top: 4px;
    font-size: 14px;
    min-height: 20px;
    transition: opacity 0.4s ease;
}

/* =========================================
   STANDARD CALL ACTIONS (For Incoming View)
   ========================================= */
.call-actions {
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 14px;
    border-radius: 22px;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    transform: translateY(0);
    opacity: 1;
    padding-bottom: calc(14px + env(safe-area-inset-bottom)); /* iPhone home bar */
}

.call-actions button {
    padding: 12px 10px;
    border-radius: 14px;
    font-weight: bold;
    font-size: 12px;
    color:  #1c1c1e;
    background: #ffffff; 
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    flex: 1 1 calc(33.33% - 8px);
    min-width: 75px;
}

.call-actions button:hover:not(:disabled) {
    background: #f2f2f7;
}

/* Call Accept - Soothing Apple Green instead of Neon */
.accept {
    background: #34c759 !important; 
    color: white !important;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.2);
    flex: 1;
}
.accept:hover { background: #00c862 !important; }

.decline {
    background: #ff3b30 !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.2);
    flex: 1;
}
.decline:hover { background: #e03026 !important; }

/* =========================================
   ✅ YOUTUBE SHORTS / LIVE STREAM STYLE UI 
   (For Active Video Call Controls ONLY)
   ========================================= */
#activeView .call-actions {
    position: absolute;
    right: 15px;
    bottom: 30px;
    display: flex;
    flex-direction: column; /* Vertical alignment */
    gap: 10px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: auto !important;
    padding: 0 !important;
    z-index: 10;
}

#activeView .call-actions button {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important; /* Circle buttons */
    padding: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px !important; /* Icons only */
    background: rgba(0, 0, 0, 0.65) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    flex: none !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
}

#activeView .call-actions button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* Red End Call Button */
#activeView #endBtn {
    background: rgba(255, 59, 48, 0.8) !important;
    margin-top: 10px;
}

/* Hide controls smoothly when inactive */
.controls-hidden #activeView .call-actions {
    transform: translateX(120px); /* Side slide-out animation */
    opacity: 0;
    pointer-events: none;
}

.controls-hidden .call-time-bar,
.controls-hidden .call-title,
.controls-hidden .call-status {
    opacity: 0;
    pointer-events: none;
}

.controls-hidden #localVideoPreview {
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s ease;
}

.control.active {
    background: rgba(0, 122, 255, 0.5) !important; /* Blue tint for active state */
    border: 1px solid #007aff !important;
    color: white !important;
    box-shadow: none;
}

.hidden { display: none !important; }

.screen-message {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background: rgba(18, 26, 33, 0.95);
    padding: 20px 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ✅ TABS & USERS UI CSS (Light Theme) */
.online-user-item {
    padding: 10px 15px;
    background: #ffffff;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    color: #1c1c1e;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.online-user-item:hover {
    background: rgba(0, 122, 255, 0.05);
    border-color: rgba(0, 122, 255, 0.3);
    transform: translateY(-2px);
}

.tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 15px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    color: #8e8e93;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    border-color: #007aff;
}

.profile-select, .filter-select {
    background: #f2f2f7;
    color: #1c1c1e;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 6px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    width: 32%;
}

.profile-select option, .filter-select option {
    background: #ffffff;
    color: #1c1c1e;
}

.tag-badge {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: #8e8e93;
    margin-left: 5px;
}

/* =========================================
   ✅ TRANSPARENT LIVE STREAM CHAT STYLES 
   ========================================= */
.webrtc-chat-wrapper {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 80px; /* Leave space for the right-side control buttons */
    height: 35vh;
    max-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Messages start from bottom */
    z-index: 10;
    
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transition: opacity 0.3s ease;
}

.webrtc-chat-wrapper.hidden {
    display: flex !important; /* Keep display flex to allow transitions */
    opacity: 0;
    pointer-events: none;
}

/* Completely hide header */
.webrtc-chat-header {
    display: none !important;
}

/* Messages Area (Invisible background) */
.webrtc-chat-messages {
    flex: none;
    max-height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 5px 10px 0;
    scrollbar-width: none; /* Firefox scrollbar hide */
}
.webrtc-chat-messages::-webkit-scrollbar { 
    display: none; /* Chrome scrollbar hide */
}

/* Pure Text Messages (No Bubble) */
.chat-msg-wrapper {
    max-width: 100%;
    align-self: flex-start !important; /* All messages aligned to the left */
    flex-direction: row;
}

.chat-msg {
    background: transparent !important;
    font-size: 15px;
    font-weight: 600;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    word-wrap: break-word;
    
    /* 🚀 Text shadow to make it glow/readable over the video */
    color: #ffffff !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
}

/* User's own messages shown in a different color (Yellow/Gold) */
.chat-msg-wrapper.self .chat-msg {
    color: #FFD700 !important; 
}

/* Hide time and modify system messages */
.chat-time { 
    display: none !important; 
}
.chat-sys-msg { 
    background: transparent !important;
    color: rgba(255,255,255,0.8) !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    border: none;
    font-size: 12px;
    align-self: flex-start;
    padding: 0;
}

/* Sleek Input Box */
.webrtc-chat-input-area {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: flex;
    gap: 10px;
    align-items: center;
}

.webrtc-chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 20px;
    padding: 10px 16px;
    outline: none;
}
.webrtc-chat-input::placeholder { 
    color: rgba(255,255,255,0.7); 
}

/* Circle Send Icon Button */
.webrtc-chat-send-btn {
    background: rgba(0, 122, 255, 0.8) !important;
    color: white !important;
    border-radius: 50% !important;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0 !important; /* Hide old text */
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.2) !important;
    cursor: pointer;
}
.webrtc-chat-send-btn::after {
    content: '➤'; /* Send Icon */
    font-size: 18px;
    margin-left: 2px;
    color: white;
}

/* Chat Notification Badge (adjusted for side button) */
.chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff3b30; 
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    min-width: 10px;
    text-align: center;
    border: 1.5px solid #121a21; 
}
