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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  transition: background 0.4s ease;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOP BAR */
#topBar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  color: white;
  z-index: 100;
}

/* MAIN AREA */
#mainArea {
  position: relative;
  flex: 1;
  width: 100%;
  height: calc(100vh - 120px);
  margin-top: 50px;
}

/* REMOTE VIDEO WRAPPER */
#remoteVideoWrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

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

/* LOCAL VIDEO WRAPPER */
#localWrapper {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 220px;
  height: 135px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.2);
  z-index: 10;
  background: #0f172a;
}

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

#aiCanvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* STILIZÁLT HUMÁNFEJ AVATAR PLACEHOLDER */
.avatar-placeholder {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #1e293b;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.avatar-placeholder svg {
  width: 80px;
  height: 80px;
  color: #64748b;
}

#localWrapper .avatar-placeholder svg {
  width: 40px;
  height: 40px;
}

.no-video video {
  display: none !important;
}

.no-video .avatar-placeholder {
  display: flex !important;
}

/* CONTROL TOOLBAR (Legfelső réteg) */
#controls {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  background: rgba(15, 23, 42, 0.85);
  padding: 10px 20px;
  border-radius: 30px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  z-index: 1000;
}

#controls button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #334155;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#controls button:hover {
  background: #475569;
  transform: scale(1.08);
}

#joinBtn {
  background: #16a34a !important;
}

/* WHITEBOARD */
#whiteboardContainer {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 20;
}

#whiteboard {
  width: 100%;
  height: 100%;
}

#whiteboardTools {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: #0f172a;
  padding: 8px 15px;
  border-radius: 20px;
  align-items: center;
}

#whiteboardTools button {
  padding: 6px 12px;
  background: #334155;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#whiteboardTools button.active {
  background: #2563eb;
}

/* CHAT PANEL */
#chatPanel {
  display: none;
  position: absolute;
  top: 60px;
  right: 20px;
  width: 320px;
  height: calc(100% - 150px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  flex-direction: column;
  z-index: 999;
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
}

#chatMessages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#chatInput {
  display: flex;
  padding: 10px;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

#msgBox {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: #334155;
  color: white;
  outline: none;
}

#sendMsg {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: white;
  cursor: pointer;
}