:root {
    --bg: #01A9EA;
    --card: #ffffff;
    --primary: #01A9EA;
    --danger: #ef4444;
    --success: #22c55e;
    --text: #334155;
    --input-bg: #f1f5f9;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    display: flex;
    justify-content: center;
    padding-top: 50px;
    transition: background 0.5s ease;
}

/* --- FULLSCREEN BIJELI MOD (KADA POZIV POČNE) --- */
body.call-active-mode {
    background: #ffffff !important;
    padding-top: 0;
}

body.call-active-mode .wrap {
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
}

body.call-active-mode h1,
body.call-active-mode #login-card,
body.call-active-mode .card:not(.video-container) {
    display: none !important;
}

body.call-active-mode .video-container {
    border: none;
    box-shadow: none;
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
}

body.call-active-mode .videos {
    height: 100vh;
    border-radius: 0;
    background: #fff;
}

/* Plutajuće dugme za kraj poziva */
.hangup-overlay {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 15px 40px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
    display: block !important;
}

/* --- OSNOVNI DIZAJN --- */
.wrap { width: 90%; max-width: 1100px; }
h1 { font-weight: 800; text-align: center; margin-bottom: 30px; color: white; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }

.card {
    background: var(--card);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.grid { display: grid; grid-template-columns: 350px 1fr; gap: 20px; }
.hidden { display: none !important; }

.row { display: flex; gap: 10px; align-items: center; } /* (malo urednije) */

.videos {
    position: relative;
    width: 100%;
    height: 500px;
    background: #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
}

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

.local-box {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 180px;
    height: 120px;
    border: 4px solid white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    border-radius: 12px;
    z-index: 10;
    overflow: hidden;
}
#localVideo { width: 100%; height: 100%; object-fit: cover; }

.user {
    padding: 12px;
    background: #f8fafc;
    margin: 8px 0;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
}

input {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: var(--input-bg);
    color: #334155;
}

button {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

/* ===== SELF PREVIEW (kad nije u pozivu) ===== */
body:not(.call-active-mode) .remote-box {
    display: none;
}

body:not(.call-active-mode) .local-box {
    position: relative;
    width: 100%;
    height: 100%;
    bottom: auto;
    right: auto;
    border: none;
    box-shadow: none;
    border-radius: 15px;
}

body:not(.call-active-mode) #localVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


#btnRegister, #btnCall { background: var(--primary); color: white; }
.ok { background: var(--success); color: white; }
.bad { background: var(--danger); color: white; }
