/* ==========================================================================
   BARIŞ WEB GÖRÜŞME SİSTEMİ - MODERN DESIGN SYSTEM (GLASSMORPHISM)
   ========================================================================== */

:root {
    --bg-dark: #09090b;
    --card-bg: rgba(22, 22, 26, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-blue: #0088ff;
    --accent-blue-glow: rgba(0, 136, 255, 0.4);
    --accent-green: #107c41;
    --accent-red: #d9381e;
    --text-primary: #f4f4f5;
    --text-muted: #a1a1aa;
    --glass-blur: blur(20px);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ================= BACKGROUND GRAPHICS ================= */
.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-blue) 0%, rgba(0,136,255,0) 70%);
    top: -100px;
    left: -100px;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 124, 65, 0.45) 0%, rgba(16,124,65,0) 70%);
    bottom: -150px;
    right: -150px;
}

/* ================= APP CONTAINER & PANEL SWITCHING ================= */
.app-container {
    width: 100%;
    max-width: 480px;
    height: 90vh;
    max-height: 800px;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.panel {
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 30px;
    display: none;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.panel.active {
    display: flex;
}

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

/* ================= BRAND & PANEL HEADER ================= */
.panel-header {
    text-align: center;
    margin-bottom: 30px;
}

.brand-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 15px rgba(0, 136, 255, 0.2);
}

.brand-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ================= FORMS & INPUTS ================= */
.glass-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.input-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.input-group input, .dialog-text-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.25s ease;
}

.input-group input:focus, .dialog-text-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 15px var(--accent-blue-glow);
}

.premium-btn {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0066cc 100%);
    border: none;
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 136, 255, 0.25);
    transition: all 0.25s ease;
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(0, 136, 255, 0.35);
}

.premium-btn:active {
    transform: translateY(0);
}

.error-msg {
    color: #ff3344;
    font-size: 12.5px;
    text-align: center;
    min-height: 18px;
}

/* ================= LOBBY PANEL ================= */
.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

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

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0055aa 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 8px 16px rgba(0, 136, 255, 0.2);
}

.user-info h2 {
    font-size: 16px;
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
}

.status-badge.green {
    color: #00cc66;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.logout-btn:hover {
    background: rgba(217, 56, 30, 0.15);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.lobby-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.users-list-container {
    flex: 1;
    overflow-y: auto;
    margin-right: -10px;
    padding-right: 10px;
}

.users-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.users-list li {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s ease;
}

.users-list li:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.user-item-name {
    font-weight: 600;
    font-size: 14.5px;
}

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

.pin-lock-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.call-btn {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0066cc 100%);
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    color: white;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.call-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 136, 255, 0.3);
}

.empty-list-msg {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 40px 0;
    background: transparent !important;
    border: none !important;
}

/* ================= VIDEO CALL PANEL ================= */
.call-panel {
    padding: 0;
    overflow: hidden;
    position: relative;
    display: none;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    background-color: #050507;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
}

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

.remote-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #0d0d11;
    z-index: 2;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s linear infinite;
}

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

.local-video-pip {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 100px;
    height: 140px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background-color: #121216;
    overflow: hidden;
    z-index: 5;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

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

/* ================= FLOATING CONTROLS ================= */
.call-controls-bar {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background: rgba(18, 18, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 10px 18px;
    border-radius: 20px;
    display: flex;
    gap: 16px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.control-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    transition: all 0.25s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
}

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

.hangup-btn {
    background: var(--accent-red);
    box-shadow: 0 8px 16px rgba(217, 56, 30, 0.3);
}

.hangup-btn:hover {
    background: #ff4c30;
    box-shadow: 0 12px 24px rgba(217, 56, 30, 0.45);
}

.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.caller-label {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.caller-label span {
    color: var(--accent-blue);
}

/* ================= MODALS ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10;
    display: none;
    justify-content: center;
    align-items: center;
}

.glass-modal {
    background: rgba(22, 22, 26, 0.75);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.glass-modal h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 15px 0 6px 0;
}

.glass-modal p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 25px;
}

.incoming-pulse-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    margin: 0 auto;
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 136, 255, 0.4); }
    70% { transform: scale(1.08); box-shadow: 0 0 0 15px rgba(0, 136, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 136, 255, 0); }
}

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

.modal-btn {
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
}

.accept-btn {
    background: var(--accent-blue);
    color: white;
}

.accept-btn:hover {
    box-shadow: 0 6px 15px rgba(0, 136, 255, 0.25);
}

.decline-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.decline-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dialog-text-input {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
    font-weight: bold;
}

/* ================= SYSTEM DISABLED SCREEN ================= */
.system-disabled-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #09090b;
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.disabled-content {
    max-width: 400px;
}

.warning-large {
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
    animation: warningPulse 2s infinite ease-in-out;
}

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

.disabled-content h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--accent-red);
}

.disabled-content p {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 22px;
}

/* ================= SCROLLBAR ================= */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ================= LIGHT MODE COMPATIBILITY ================= */
@media (prefers-color-scheme: light) {
    :root {
        --bg-dark: #f4f4f5;
        --card-bg: rgba(255, 255, 255, 0.7);
        --border-color: rgba(9, 9, 11, 0.1);
        --text-primary: #09090b;
        --text-muted: #71717a;
    }
    .panel {
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    .portal-card {
        background: rgba(255, 255, 255, 0.8) !important;
        border-color: rgba(9, 9, 11, 0.12) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05) !important;
    }
    .portal-card h3 {
        color: #09090b !important;
    }
    .premium-btn, a.premium-btn, button.premium-btn {
        color: #ffffff !important;
    }
}
