:root {
    --bg-color: #0b0f19;
    --panel-bg: rgba(20, 27, 45, 0.7);
    --primary: #4ade80;
    --primary-hover: #22c55e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-color) 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    text-align: center;
}

@media (max-width: 600px) {
    body {
        align-items: flex-start;
        padding: 0;
    }
    .app-container {
        padding: 1.5rem 1rem;
        border-radius: 0;
        border: none;
        min-height: 100vh;
        box-shadow: none;
    }
    h1 {
        font-size: 2rem;
    }
    .input-group {
        flex-direction: column;
    }
    .input-group button {
        width: 100%;
        padding: 16px;
    }
    .modal-content {
        padding: 30px 20px;
        min-width: 90%;
    }
    .avatar-container {
        gap: 10px;
    }
    .user-avatar {
        width: 65px;
        height: 65px;
        font-size: 1rem;
    }
}

header {
    margin-bottom: 3rem;
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.connection-panel {
    animation: fadeIn 0.5s ease;
}

.connection-panel h2 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.connection-panel p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 1rem;
}

input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

.primary-btn {
    background: var(--primary);
    color: #000;
    font-weight: 600;
    padding: 0 24px;
    border-radius: 12px;
    font-size: 1.1rem;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.status-msg {
    color: var(--danger);
    font-size: 0.9rem;
    min-height: 20px;
}

.hidden {
    display: none !important;
}

/* Call Panel */
.call-panel {
    animation: fadeIn 0.5s ease;
}

.avatar-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 2rem;
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.user-avatar.speaking {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

.connection-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    position: relative;
    max-width: 100px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
    top: -3px;
    left: 0;
    animation: slideLine 2s infinite ease-in-out;
    opacity: 0;
}

.call-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.room-display {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

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

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: white;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

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

.control-btn.danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.muted {
    color: var(--danger) !important;
}

@keyframes slideLine {
    0% { left: 0; opacity: 0; }
    50% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

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

/* Friends List */
.friends-list {
    list-style: none;
    margin-top: 10px;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
}

.friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.friend-info strong {
    display: block;
    color: var(--text-main);
}
.friend-info small {
    color: var(--text-muted);
}

.call-friend-btn {
    background: var(--primary);
    color: black;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.call-friend-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* Incoming Call Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--panel-bg);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    min-width: 300px;
}

.pulse-ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: ringPulse 1.5s infinite;
    z-index: -1;
}

@keyframes ringPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

.modal-actions {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.action-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}
.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.accept {
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
    color: black;
}
.action-btn.reject {
    background: var(--danger);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}
