:root {
    --bg-color: #0f111a;
    --panel-bg: rgba(255, 255, 255, 0.05);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #8b92a5;
    --primary: #6c5ce7;
    --primary-hover: #8172ff;
    --success: #00b894;
    --success-hover: #00d2a9;
    --danger: #ff7675;
    --danger-hover: #ff9190;
    --radius-lg: 16px;
    --radius-md: 12px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #1f1b3b, #0f111a);
    overflow: hidden;
}

#app {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    position: relative;
    padding: 20px;
}

/* Glassmorphism */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Screens */
.screen {
    display: none;
    height: 100%;
    animation: fadeIn 0.4s ease forwards;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

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

/* Login Screen */
#login-screen {
    justify-content: center;
    align-items: center;
}

.login-panel {
    padding: 40px;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.login-panel h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.highlight {
    color: var(--primary);
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-panel p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.3);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    color: white;
}

.btn:active {
    transform: scale(0.95);
}

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

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

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

.btn-glow:hover {
    box-shadow: 0 0 15px currentColor;
}

#login-form .btn {
    width: 100%;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--success);
    background: rgba(0, 184, 148, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 184, 148, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 184, 148, 0); }
}

.main-panel {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

#users-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.user-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    padding: 15px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.user-card:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Call Screen */
.call-header {
    text-align: center;
    margin-bottom: 20px;
}

#call-status {
    color: var(--success);
    font-size: 0.9rem;
    margin-top: 5px;
}

.video-grid {
    display: flex;
    flex-grow: 1;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
}

.video-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.remote-container {
    flex-grow: 1;
    width: 100%;
}

.local-container {
    position: absolute;
    width: 200px;
    height: 150px;
    bottom: 20px;
    right: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: transform 0.3s;
}

.local-container:hover {
    transform: scale(1.05);
}

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

.video-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: white;
}

.controls-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--panel-border);
}

.icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn.active {
    background: rgba(255, 255, 255, 0.2);
}

.icon-btn:not(.active) {
    background: var(--danger);
    position: relative;
}

.icon-btn:not(.active)::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 30px;
    background: white;
    transform: rotate(45deg);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-panel {
    padding: 40px;
    text-align: center;
    width: 100%;
    max-width: 350px;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-actions .btn {
    flex: 1;
}

.avatar-ring {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    position: relative;
}

.ringing-animation {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    animation: ring 1.5s infinite ease-out;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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