:root {
  --background-dark: #121212;
  --panel-background: #1e1e1e;
  --surface: #1e1e1e;
  --primary-accent: #8A2BE2;
  --primary-accent-darker: #7b2cbf;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --border-color: #333333;
  --error-color: #e53935;
  --success-color: #43a047;
}

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

body {
  height: 100dvh;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  background-color: var(--background-dark);
  color: var(--text-primary);
}

/* Hide scrollbar for Chrome, Safari and Opera */
*::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
* {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

#app-container {
  display: flex;
  flex-direction: row;
  height: 100dvh;
  width: 100vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out;
}

body.in-call #app-container {
  opacity: 1;
  visibility: visible;
}

#lobby {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  background: rgba(18, 18, 18, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.5s ease, visibility 0.5s ease;
  overflow-y: auto;
}

body.in-call #lobby {
  opacity: 0;
  visibility: hidden;
}

.lobby-content {
  text-align: center;
  padding: 2rem;
  max-height: 100dvh;
  overflow-y: auto;
  padding-bottom: 5rem;
}

.stats-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem auto 2rem;
  max-width: 600px;
  width: 100%;
}

.stat-box {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.2rem 0.5rem;
  flex: 1;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(138, 43, 226, 0.3);
  border-color: rgba(138, 43, 226, 0.5);
}

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-accent);
  margin-bottom: 0.2rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.seo-description {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 500px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

.app-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#userDisplay {
  display: flex;
  align-items: center;
}

.profile-container {
  position: relative;
  cursor: pointer;
}

#userAvatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary-accent);
  object-fit: cover;
  transition: transform 0.3s;
}

#userAvatar:hover {
  transform: scale(1.1);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--panel-background);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.5rem;
  min-width: 150px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.dropdown-menu.hidden {
  display: none;
}

#userNameDisplay {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

#logoutBtn {
  background: var(--error-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: 15px;
  width: 100%;
  cursor: pointer;
}

.app-header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-header .logo span {
  background: linear-gradient(135deg, var(--primary-accent), #00d2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

#installPwaBtn {
  background: linear-gradient(135deg, var(--primary-accent), #2b997c);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(78, 204, 163, 0.4);
}

.lobby-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem 2rem 5rem 2rem;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.lobby-content h1 {
  font-size: 4rem;
  font-weight: 700;
  background: -webkit-linear-gradient(45deg, var(--primary-accent), #c788f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.lobby-intro {
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.lobby-intro h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.lobby-intro h1 span {
  background: linear-gradient(135deg, var(--primary-accent), #00d2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lobby-intro p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Sidebar Styles */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.sidebar-backdrop.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100%;
  background: #14161c;
  z-index: 2001;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.app-sidebar::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari */
}

.app-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 1.5rem 1rem;
  position: relative;
}

.sidebar-user-card {
  width: 100%;
  background: #1c1f26;
  border-radius: 20px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.sidebar-user-card:hover {
  background: #252932;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.sidebar-chevron {
  color: var(--text-secondary);
  opacity: 0.5;
}

.sidebar-login-container {
  margin-top: 0.5rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

#sidebarUserAvatar {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  object-fit: cover;
  background-color: #2a2a2a;
}

.user-details h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details p {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0.1rem 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 16px;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
}

.nav-item:hover, .nav-item.active {
  background: rgba(30, 80, 255, 0.1);
  color: #3b82f6;
}

.nav-item svg {
  opacity: 0.7;
}

.nav-item:hover svg, .nav-item.active svg {
  opacity: 1;
  stroke: #3b82f6;
}

.nav-item.danger {
  color: #ff453a;
  margin-top: auto;
}

.nav-item.danger:hover {
  background: rgba(255, 69, 58, 0.1);
}

.nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.sidebar-footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
}

.lobby-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  padding: 1rem;
  background: rgba(18, 18, 18, 0.95);
  border-top: 1px solid var(--border-color);
  z-index: 100;
}

.private-meeting-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  width: 100%;
}

.action-buttons-row {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 600px;
  justify-content: center;
}

.divider {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: bold;
}

#roomLinkContainer {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 400px;
}

#roomLinkInput {
  background: transparent;
  border: none;
  color: var(--primary-accent);
  flex: 1;
  font-size: 0.9rem;
  outline: none;
  cursor: default;
}

#copyLinkBtn {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

#statusMessage {
  margin-bottom: 2rem;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  background-color: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

#statusMessage.status-searching {
  color: var(--primary-accent);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.7);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 10px 20px rgba(138, 43, 226, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(138, 43, 226, 0);
  }
}

#video-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: #000;
}

.video-wrapper {
  flex: 1 1 300px;
  height: 100%;
  width: 100%;
  position: relative;
  background-color: #000;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-label {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 2;
}

#localVideo {
  transform: scaleX(-1);
}

.placeholder {
  color: var(--text-secondary);
  font-size: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  align-content: center;
  text-align: center;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
}

body.in-call .video-wrapper video[srcObject]+.video-label+.placeholder {
  display: none;
}

/* --- NEW MODERN CALL UI --- */

.call-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
  z-index: 100;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.caller-info {
  text-align: center;
}

.caller-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
}

.call-timer {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  font-variant-numeric: tabular-nums;
}

.header-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.options-wrapper {
  position: relative;
}

.options-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--panel-background);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.5rem;
  min-width: 160px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-item {
  background: transparent;
  border: none;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
  justify-content: flex-start;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-item.danger {
  color: #ff453a;
}

.menu-item.danger:hover {
  background: rgba(255, 69, 58, 0.1);
}

.call-controls {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem 1.5rem;
  border-radius: 40px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
}

.control-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s;
  position: relative;
}

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

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

.control-btn.off {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
}

.control-btn.hang-up {
  background: #ff3b30;
  width: 60px;
  height: 60px;
}

.control-btn.hang-up:hover {
  background: #ff453a;
  transform: scale(1.1) rotate(135deg);
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff3b30;
  color: white;
  font-size: 10px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--panel-background);
  z-index: 10;
}

.control-btn svg {
  width: 24px;
  height: 24px;
}

/* PiP Layout and Dragging */
.video-wrapper:has(#localVideo) {
  position: absolute;
  width: 120px;
  height: 180px;
  bottom: 100px;
  right: 20px;
  z-index: 200;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  cursor: grab;
  transition: transform 0.1s ease-out, border-color 0.3s;
}

.video-wrapper:has(#localVideo):active {
  cursor: grabbing;
}

.video-wrapper:has(#localVideo) .video-label {
  display: none; /* Hide 'You' label on PiP */
}

@media (max-width: 768px) {
  .call-controls {
    width: 90%;
    bottom: 1.5rem;
    gap: 0.5rem;
    padding: 0.75rem;
    justify-content: space-around;
  }
  
  .control-btn {
    width: 44px;
    height: 44px;
  }
  
  .control-btn.hang-up {
    width: 54px;
    height: 54px;
  }

  .video-wrapper:has(#localVideo) {
    width: 100px;
    height: 150px;
  }
}

#chat-container {
  display: flex;
  flex-direction: column;
  background-color: var(--panel-background);
  border-left: 1px solid var(--border-color);
  flex: 1;
  height: 100%;
  z-index: 99;
  transition: transform 0.3s ease-in-out;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-header h2 {
  font-weight: 600;
  color: var(--primary-accent);
}

.messages-display {
  flex-grow: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  padding: 0.6rem 1rem;
  border-radius: 18px;
  max-width: 80%;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.sent {
  background-color: var(--primary-accent);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message.received {
  background-color: #363636;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-input-area {
  display: flex;
  flex-direction: row;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  gap: 0.5rem;
  flex-shrink: 0;
}

.chat-input-area input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background-color: #333;
  color: var(--text-primary);
}

.chat-input-area button {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 20px;
  background-color: var(--primary-accent);
  color: white;
  border: none;
  cursor: pointer;
}

#chatInput {
  flex-grow: 1;
  padding: 0.75rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background-color: #333;
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  transition: all 0.2s ease;
}

#chatInput:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 5px var(--primary-accent);
}

button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

#startCallButton {
  background: linear-gradient(135deg, var(--primary-accent), #00d2ff);
  color: white;
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

#startCallButton:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(138, 43, 226, 0.5);
  filter: brightness(1.1);
}

#viewOnlineUsersBtn {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

#viewOnlineUsersBtn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-accent);
  transform: translateY(-2px);
}

#createPrivateBtn {
  flex: 1;
  width: 100%;
  max-width: 300px;
  margin: 0 0.25rem;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 1.2;
  min-height: 54px;
  border-radius: 12px;
}

#startCallButton,
#sendChatButton {
  background-color: var(--primary-accent);
  color: white;
}

#endCallButton {
  background-color: var(--error-color);
  color: white;
}

button:disabled {
  background-color: #555 !important;
  color: #999 !important;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Removed old floating toggle chat button styles */

#closeChatBtn.mobile-only {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  margin-left: auto;
  cursor: pointer;
}

.displaynone {
  display: none !important;
}

.hidden {
  display: none !important;
}



@media (max-width: 768px) {
  #app-container {
    flex-direction: column;
  }

  #video-container {
    padding: 0;
    height: 100dvh;
  }

  .video-wrapper {
    flex: 1 1 100%;
    height: 100%;
  }

  #chat-container {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    background-color: var(--panel-background);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 99;
  }

  #chat-container.open {
    transform: translateY(0%);
  }

  #toggleChatBtn {
    display: block;
  }

  #closeChatBtn.mobile-only {
    display: block;
  }

  body.chat-open #video-container {
    display: none;
  }

  .lobby-content h1 {
    font-size: 2.5rem;
  }

  .chat-header h2 {
    font-size: 1.2rem;
  }

  #chatInput {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
  }

  button {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.modal-content h2 {
  margin-bottom: 0.5rem;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-actions button {
  flex: 1;
  padding: 0.8rem;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  color: white !important;
}

.btn-success {
  background: var(--success-color);
}

.btn-error {
  background: var(--error-color);
}

.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  padding: 0.2rem;
}

.auth-tabs button {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.5rem;
  font-size: 0.85rem;
  border-radius: 6px;
  transition: background 0.3s;
  color: white;
}

.auth-tabs button.active {
  background: var(--primary-accent);
  color: white;
}

#authForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#authForm input,
#authForm select {
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #333;
  color: white;
  font-size: 0.9rem;
  outline: none;
}

#authForm select option {
  background: #1e1e1e;
  color: white;
}

#authForm input.hidden,
#authForm select.hidden {
  display: none;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  margin-top: 1rem;
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.users-modal {
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  padding: 0;
  width: auto;
  color: var(--text-secondary);
}

.users-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.user-name {
  font-weight: bold;
  color: var(--text-primary);
  font-size: 1rem;
}

.users-page .lobby-content {
  padding: 1rem;
  padding-bottom: 8rem;
  max-width: 600px;
  margin: 0 auto;
}

.users-container {
  width: 100%;
}

.section-header {
  margin-bottom: 2rem;
  text-align: center;
}

.section-header h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--primary-accent);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.online-users-page-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.user-card {
  padding: 0;
  border: none;
  background: transparent;
}

.user-card-patti {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  width: 100%;
  transition: background 0.3s, transform 0.2s;
}

.user-card-patti:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(5px);
}

.user-avatar-patti {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-accent);
}

.user-info-patti {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-main-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-name-patti {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.status-indicator-patti {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator-patti.online {
  background: var(--success-color);
  box-shadow: 0 0 5px var(--success-color);
}

.status-indicator-patti.offline {
  background: #555;
}

.user-sub-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.separator {
  opacity: 0.5;
}

.call-btn-patti {
  background: var(--primary-accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.call-btn-patti:hover {
  filter: brightness(1.1);
}

.call-btn-patti:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
}

.loading-spinner {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.status-indicator.online {
  background: var(--success-color);
  box-shadow: 0 0 8px var(--success-color);
}

.status-indicator.offline {
  background: #666;
}

.user-status-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.user-card.offline {
  opacity: 0.7;
}

.user-card.offline .call-btn {
  background: #444;
  cursor: not-allowed;
}

.user-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.fixed-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  display: flex;
  justify-content: center;
}

.bottom-bar-content {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: center;
}

.back-btn {
  background: #1a1a2e;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.8rem 2rem;
  border-radius: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  text-decoration: none;
}

/* Incoming Call Animation */
.incoming-call-animation {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary-accent);
  opacity: 0;
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
    color: var(--success);
  }

  100% {
    opacity: 1;
  }
}

.animate-pulse {
  animation: pulse 1.5s infinite;
}
/* Match Filters UI */
.match-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.filter-group label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.gender-toggles {
  display: flex;
  gap: 10px;
}

.gender-toggles input[type="radio"] {
  display: none;
}

.gender-toggles label {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.gender-toggles input[type="radio"]:checked + label {
  background: var(--primary-color);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.nearby-group {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.nearby-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.nearby-group label {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
}

/* Profile Setup Modal */
#profileSetupModal .modal-content {
  text-align: center;
}

#profileSetupModal h2 {
  margin-bottom: 5px;
}

#profileSetupModal p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.setup-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.setup-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-select {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-color);
  color: var(--text-primary);
}

/* Users Page Filter Tabs */
.filter-tabs-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 15px auto 35px auto;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  padding: 10px 24px;
  border-radius: 25px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.1);
}

.filter-tab.active {
  background: var(--primary-color);
  color: var(--text-primary);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}
/* Auth Modal Tabs & Forms */
.auth-modal-content {
  width: 95%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 25px;
  /* Hide scrollbar for Chrome, Safari and Opera */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

.auth-modal-content::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.auth-tabs {
  display: flex;
  justify-content: space-around;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 25px;
}

.auth-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.auth-tab-btn:hover {
  color: var(--text-primary);
}

.auth-tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-form.hidden {
  display: none !important;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-form-input {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

.auth-form-input:focus {
  border-color: var(--primary-color);
}
