/* ============================================================
   ORIGINAL STYLE3.CSS (FULLY PRESERVED)
============================================================ */

/*------ File style3.css --- */
/* ----- ROOT VARIABLES -----*/
:root {
    --bg: #f5f5f5;
    --primary: #005bbb;
    --primary-dark: #00408a;
    --accent: #ffb300;
    --danger: #c62828;
    --text: #111;
    --text-light: #fff;
    --card-bg: #ffffff;
    --border: #d0d0d0;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --font-lg: 2.0rem;
    --font-xl: 2.2rem;
    --font-xxl: 2.8rem;
    --button-height: 3.5rem;
}

* {
    box-sizing: border-box;
}

/* =========================
   NAV (taken from style.css)
   ========================= */
nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    background: #003f66;
    padding: 0.5rem;
}

nav a {
    color: #f9f9f0;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
}

nav a.active {
    color: #FFFF00;
    text-decoration: underline;
    background-color: #005f99;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
}

header {
    text-align: center;
    padding: 1rem;
    background-color: #005f99;
    color: white;
}

.header-title {
    font-size: var(--font-xxl);
    font-weight: 700;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: var(--bg);
    justify-content: center;
    color: var(--text);
    font-weight: bold;
}

.app {
    margin-top: 40px;
    padding: 24px;
    background: #727272;
    border-radius: 12px;
    width: 900px;
    align-items: flex-start;
}

.top-bar {
    position: fixed;
    top: 0;
    width: 100%;
    background: #003366;
    padding: 10px;
    display: flex;
    justify-content: space-around;
    z-index: 1000;
}

.setup-btn-top {
    position: absolute;
    top: 150px;
    right: 20px;
    z-index: 2000;
    font-size: 1.2rem;
    padding: 10px 18px;
    background: #444;
    color: white;
    border: none;
    border-radius: 8px;
}

.quit-btn {
    font-size: 3.0rem;
    background: #cc0000;
}

.home-container {
    padding-top: 60px;
    text-align: center;
}

.page-title {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.instructions {
    font-size: 1.5rem;
    margin: 10px 20px 30px;
}

.arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 10;
}

#leftArrow {
    left: 20px;
}

#rightArrow {
    right: 20px;
}

.carousel {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    height: 380px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 20px;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 420px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.contact-card {
    min-width: 250px;
    max-width: 300px;
    margin: 0 15px;
    background: white;
    border-radius: 12px;
    border: 4px solid transparent;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: border 0.3s;
    position: static !important;
    float: none !important;
    display: block !important;
    margin: 0 15px !important;
}

.contact-card.selected {
    border: 4px solid red;
}

.contact-photo {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
}

.contact-name {
    font-size: 1.6rem;
    margin-top: 10px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.25);
}

.contact-relation {
    font-size: 1.3rem;
    color: #555;
}

.quit-page-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 1.4rem;
    padding: 12px 20px;
    background: #cc0000;
    color: white;
    border: none;
    border-radius: 8px;
    z-index: 999;
}

.setup-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 1.4rem;
    padding: 12px 20px;
    background: #444;
    color: white;
    border: none;
    border-radius: 8px;
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.contact-card:hover {
    transform: scale(1.05);
    transition: transform 0.2s;
}

/* ============================================================
   NEW CALL UI (ADDED SAFELY)
============================================================ */

#remoteVideo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  background: #000;
  z-index: 1;
}

#localVideo {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 160px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  background: #222;
  border: 2px solid #fff;
  z-index: 3;
  cursor: grab;
}

#incomingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#incomingOverlay.active {
  opacity: 1;
  pointer-events: auto;
}

#callerPhoto {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  animation: pulse 1.8s infinite ease-in-out;
  cursor: pointer;
}

#callerName {
  margin-top: 25px;
  font-size: 32px;
  color: white;
  text-align: center;
  font-weight: bold;
}

#callingText {
  margin-top: 10px;
  font-size: 22px;
  color: #ccc;
}

#cancelBtn {
  margin-top: 40px;
  padding: 14px 28px;
  font-size: 20px;
  background: #aa0000;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.6); }
  70% { transform: scale(1.08); box-shadow: 0 0 20px 20px rgba(255,255,255,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
