* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* Auth Section */
.auth-box {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-top: 80px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 28px;
}

.tabs {
    display: flex;
    margin-bottom: 25px;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
    background: #f9f9f9;
}

form input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

form input::placeholder {
    color: #aaa;
}

form button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

#auth-message {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header h2 {
    color: #333;
    font-size: 22px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #555;
    font-size: 14px;
}

.user-info button {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    background: #ff4757;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.user-info button:hover {
    background: #ff6b7a;
}

/* Users List */
.users-list {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.users-list h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

.user-item:hover {
    transform: translateX(5px);
}

.user-item .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: #2ed573;
    box-shadow: 0 0 10px #2ed573;
}

.status-dot.offline {
    background: #ccc;
}

.user-name {
    color: #333;
    font-weight: 600;
    font-size: 15px;
}

.user-username {
    color: #999;
    font-size: 13px;
}

.call-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.call-btn:hover {
    transform: scale(1.05);
}

.call-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ==================== CALL OVERLAY ==================== */
#call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Incoming UI */
#incoming-ui {
    text-align: center;
}

.call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    margin: 0 auto 25px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.call-name {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
    color: white;
}

.call-incoming-text {
    color: #aaa;
    margin-bottom: 40px;
    font-size: 16px;
}

.call-buttons {
    display: flex;
    gap: 50px;
    justify-content: center;
}

.btn-call-act {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-call-act:hover {
    transform: scale(1.1);
}

.btn-end {
    background: #ff4757;
    box-shadow: 0 5px 20px rgba(255, 71, 87, 0.4);
}

.btn-ans {
    background: #2ed573;
    box-shadow: 0 5px 20px rgba(46, 213, 115, 0.4);
}

.btn-mic {
    background: #333;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.btn-cam {
    background: #333;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.btn-call-act.off {
    background: #ff4757;
}

/* In Call UI */
#in-call-ui {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

#remote-video {
    width: 100%;
    height: 100%;
    /* object-fit: cover; */
    background: #1a1a2e;
}

#local-video {
    position: absolute;
    bottom: 120px;
    right: 25px;
    width: 150px;
    height: 110px;
    border-radius: 15px;
    /* object-fit: cover; */
    border: 3px solid #667eea;
    background: #1a1a2e;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

#local-video.enlarged {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border: none;
    border-radius: 0;
    z-index: 10;
}

.call-status {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: #667eea;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.call-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 25px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 30px;
    border-radius: 40px;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .auth-box {
        padding: 25px;
        margin-top: 40px;
    }
    
    .auth-box h2 {
        font-size: 24px;
    }
    
    .header {
        padding: 12px 15px;
    }
    
    .header h2 {
        font-size: 18px;
    }
    
    .user-info span {
        font-size: 12px;
    }
    
    .call-avatar {
        width: 100px;
        height: 100px;
        font-size: 50px;
    }
    
    .call-name {
        font-size: 24px;
    }
    
    .btn-call-act {
        width: 60px;
        height: 60px;
    }
    
    #local-video {
        width: 100px;
        height: 75px;
        bottom: 100px;
        right: 15px;
    }
    
    .call-buttons {
        gap: 40px;
    }
}