/* Enhanced Responsive Video Call Interface CSS */

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

body {
  background-color: #212032;
  overflow: hidden;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: #e8eaed;
  height: 100vh;
}

/* Enhanced CSS Variables for consistent theming */
:root {
  --primary-bg: #1a1a1a;
  --secondary-bg: #2d2d30;
  --toolbar-bg: #202124;
  --accent-color: #5A6BFF;
  --danger-color: #ea4335;
  --success-color: #34a853;
  --warning-color: #fbbc04;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --border-color: #5f6368;
  --hover-bg: #3c4043;
  --shadow-light: rgba(0, 0, 0, 0.2);
  --shadow-medium: rgba(0, 0, 0, 0.3);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Legacy variables for backward compatibility */
  --old-primary-bg: #212032;
  --old-secondary-bg: #1a2634;
  --old-danger-color: #FF5D5D;
}

/* Text utilities */
.text-white { color: var(--text-primary); }
.text-black { color: black; }
.text-primary { color: var(--accent-color); }
.text-secondary { color: var(--text-secondary); }

/* JOIN PAGE STYLES */
#joinPage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--secondary-bg);
  z-index: 999;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Logo section - responsive */
.logo-section {
  margin-top: 50px;
  text-align: center;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.logo-section img {
  height: 90px;
  width: auto;
  margin-bottom: 10px;
  image-rendering: -webkit-optimize-contrast;
}

.logo-section h1 {
  color: var(--text-primary);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.logo-section p {
  color: var(--text-secondary);
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  margin: 0;
}

/* Main background container */
.main-bg {
  display: flex;
  width: 100%;
  max-width: 1200px;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

/* Join left section (video preview) */
.join-left {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Video view container */
.video-view {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 16/9;
  background: #1C1C1C;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.video-view .video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #1C1C1C;
}

/* Camera status */
#camera-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-primary);
  font-size: clamp(14px, 3vw, 18px);
  text-align: center;
  z-index: 2;
}

/* Network stats */
#network-stats {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: 0.5px solid white;
  border-radius: 6px;
  font-size: 12px;
  z-index: 3;
}

#download-speed-div,
#upload-speed-div {
  padding: 2px 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

#upload-speed-div {
  border-left: 0.5px solid white;
}

#refresh {
  padding: 6px;
  cursor: pointer;
  border-left: 0.5px solid white;
}

/* Network error states */
#network-error-offline,
#network-error-online {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  flex-direction: row;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  color: red;
  border: 0.5px solid red;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  z-index: 3;
}

/* Video controls in preview */
.video-view .video-content {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 2;
}

#micButton,
#camButton {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

#micButton {
  background-color: var(--danger-color);
}

#camButton {
  background-color: var(--danger-color);
}

#micButton.enabled,
#camButton.enabled {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Permission denied icons */
#no-microphone-permission,
#no-camera-permission {
  display: none;
  align-items: center;
  justify-content: center;
}

/* Device selection dropdowns */
.device-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
  width: 100%;
  justify-content: center;
}

.btn-group {
  flex: 1;
  min-width: 140px;
  position: relative;
  display: inline-flex;
}

.btn-group .dropdown-toggle::after {
  display: none;
}

.media-permission {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-menu {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow-medium);
  padding: 4px 0;
  margin-top: 4px;
}

.dropdown-menu li,
.dropdown-item {
  padding: 10px 16px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-menu li:hover,
.dropdown-item:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

/* Join right section (form) */
.join-right {
  flex: 1;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  padding: 20px;
}

/* Form inputs */
input[type="text"] {
  width: 100%;
  max-width: 350px;
  height: 50px;
  background-color: var(--primary-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 15px;
  font-size: 16px;
  text-align: center;
  transition: var(--transition);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(90, 107, 255, 0.2);
}

input[type="text"]::placeholder {
  color: var(--text-secondary);
}

/* Enhanced Buttons */
.btn {
  min-height: 50px;
  padding: 12px 30px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

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

.btn-primary:hover {
  background-color: #4956E8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(90, 107, 255, 0.3);
}

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

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

.inner-join-button {
  width: 100%;
  max-width: 350px;
}

/* Join meeting input states */
.join-meeting-input {
  display: none;
  width: 100%;
}

.join-btn {
  width: 100%;
}

/* MAIN CALL PAGE STYLES */
.grid-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--primary-bg);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Enhanced Top toolbar */
.grid-page .row {
  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px var(--shadow-light);
}

/* Enhanced Meeting ID section */
.meeting-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Meeting ID input */
#meetingid {
  flex: 1; /* take available width */
  background-color: #212032;
  color: #ffffff;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
}

#meetingid:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}
/* Copy Button */
#btnCopy {
  display: flex;
  align-items: center;
  gap: 6px; /* space between icon & text */
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #ffffff;
  background-color: transparent;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

/* Hover effect */
#btnCopy:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Click/active effect */
#btnCopy:active {
  transform: translateY(0);
  background-color: rgba(255, 255, 255, 0.2);
}

/* Material icon inside button */
#btnCopy .material-icons {
  font-size: 18px;
  line-height: 1;
}

/* Button text */
#btnCopy .copyContent {
  font-size: 13px;
  font-weight: 500;
}

/* Enhanced Toolbar controls */
.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.toolbar-controls::-webkit-scrollbar {
  display: none;
}

/* Enhanced Base button styling for toolbar */
.btn-outline-light,
.toolbar-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.btn-outline-light:hover,
.toolbar-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-outline-light:focus,
.toolbar-btn:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.btn-outline-light:active,
.toolbar-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px var(--shadow-light);
}

/* Enhanced Material Icons styling */
.material-icons {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* Enhanced Specific button states */
.btn-recording {
  background-color: var(--danger-color) !important;
  border-color: var(--danger-color) !important;
  color: white !important;
  animation: pulse-recording 2s infinite;
}

@keyframes pulse-recording {
  0% { 
    box-shadow: 0 0 0 0 rgba(234, 67, 53, 0.4); 
  }
  70% { 
    box-shadow: 0 0 0 10px rgba(234, 67, 53, 0); 
  }
  100% { 
    box-shadow: 0 0 0 0 rgba(234, 67, 53, 0); 
  }
}

.btn-raised-hand {
  background-color: var(--warning-color) !important;
  border-color: var(--warning-color) !important;
  color: var(--primary-bg) !important;
}

.btn-muted {
  background-color: var(--danger-color) !important;
  border-color: var(--danger-color) !important;
  color: white !important;
}

.btn-unmuted {
  background-color: var(--success-color) !important;
  border-color: var(--success-color) !important;
  color: white !important;
}

.btn-cam-off {
  background-color: var(--danger-color) !important;
  border-color: var(--danger-color) !important;
  color: white !important;
}

.btn-cam-on {
  background-color: var(--success-color) !important;
  border-color: var(--success-color) !important;
  color: white !important;
}

.btn-screen-sharing {
  background-color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  color: white !important;
}

/* Enhanced Danger button (End call) */
.btn-danger {
  background-color: var(--danger-color) !important;
  border-color: var(--danger-color) !important;
  color: white !important;
  width: 44px;
  height: 40px;
  flex-shrink: 0;
}

.btn-danger:hover {
  background-color: #d33b2c !important;
  border-color: #d33b2c !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 67, 53, 0.3);
}

/* Enhanced Vertical separator */
.vertical-line {
  width: 1px;
  height: 24px;
  background-color: var(--border-color);
  margin: 0 8px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Dropdown toggle enhancements */
.dropdown-toggle::after {
  display: none;
}

.btn-group .dropdown-menu {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow-medium);
  padding: 4px 0;
  margin-top: 4px;
  margin-left: -80px;
}

/* Enhanced VIDEO CONTAINER - Main responsive grid */
#videoContainer {
  flex: 1;
  background-color: var(--primary-bg);
  display: grid;
  gap: 8px;
  padding: 16px;
  overflow: hidden;
}

/* Enhanced Video frame containers */
.video-frame-container,
[class*="v-"] {
  position: relative;
  background-color: var(--secondary-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow-light);
  transition: var(--transition);
}

.video-frame-container:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px var(--shadow-medium);
}

.video-frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--secondary-bg);
  border-radius: 12px;
  transition: var(--transition);
  image-rendering: crisp-edges;
}

/* Enhanced Screen sharing */
.screen-share-container {
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  height: calc(100% - 64px);
  background: var(--primary-bg);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.screen-share-video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px var(--shadow-medium);
}

/* Enhanced Side panels */
.participant-wrapper,
.chat-wrapper {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 0;
  background-color: var(--secondary-bg);
  border-left: 1px solid var(--border-color);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1100;
  overflow: hidden;
  box-shadow: -4px 0 16px var(--shadow-medium);
}

.participant-wrapper.open,
.chat-wrapper.open {
  width: 320px;
}

/* Enhanced Panel headers */
.participant-wrapper-header,
.chat-wrapper-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.participant-wrapper-header h5,
.chat-wrapper-header h5 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  color: var(--text-primary);
}

.closebtn {
  color: var(--text-secondary);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.closebtn:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

/* Enhanced Notification alerts */
.alert {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px;
  box-shadow: 0 4px 12px var(--shadow-medium);
}

.alert-info {
  border-left: 4px solid var(--accent-color);
}

/* Enhanced Tooltip styles */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--secondary-bg);
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
  margin-bottom: 4px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px var(--shadow-medium);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Enhanced Loading states */
.btn-loading {
  pointer-events: none;
  opacity: 0.6;
}

.btn-loading .material-icons {
  animation: spin 1s linear infinite;
}

/* Animations */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* RESPONSIVE BREAKPOINTS */

/* Large screens (1200px+) */
@media (min-width: 1200px) {
  .main-bg {
    gap: 4rem;
  }
  
  .video-view {
    max-width: 600px;
  }
  
  .join-right {
    max-width: 500px;
  }
}

/* Medium screens (768px - 1199px) */
@media (max-width: 1199px) {
  .main-bg {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  
  .join-left,
  .join-right {
    width: 100%;
    max-width: 600px;
  }
  
  .device-controls {
    flex-direction: column;
  }
  
  .btn-group {
    min-width: auto;
  }
}

/* Tablets (768px - 991px) */
@media (max-width: 991px) {
  #joinPage {
    padding: 15px;
  }
  
  .logo-section {
    margin-bottom: 1.5rem;
  }
  
  .video-view {
    max-width: 450px;
  }
  
  .device-controls {
    gap: 8px;
  }
  
  .media-permission {
    font-size: 12px;
    padding: 6px 10px;
  }
  
  /* Toolbar responsive */
  .grid-page .row {
    background: var(--toolbar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px var(--shadow-light);
  }
  
  .toolbar-controls {
    gap: 6px;
  }
  
  .btn-outline-light,
  .toolbar-btn {
    width: 36px;
    height: 36px;
  }
  
  .material-icons {
    font-size: 18px;
  }
  
  #meetingid {
    min-width: 150px;
    font-size: 12px;
  }
  
  .vertical-line {
    margin: 0 6px;
  }
  
  .participant-wrapper.open,
  .chat-wrapper.open {
    width: 280px;
  }
}

/* Enhanced Mobile landscape (768px wide, short height) */
@media (max-width: 768px) and (orientation: landscape) {
  #joinPage {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    padding: 10px;
  }
  
  .logo-section {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0;
  }
  
  .logo-section h1 {
    font-size: 1.5rem;
  }
  
  .main-bg {
    flex-direction: row;
    margin-top: 80px;
    width: 100%;
    max-width: none;
  }
  
  .video-view {
    height: 200px;
    max-width: 350px;
  }
}

/* Enhanced Mobile phones (up to 767px) */
@media (max-width: 767px) {
  #joinPage {
    padding: 10px;
  }
  
  .logo-section {
    margin-bottom: 1rem;
  }
  
  .logo-section img {
    height: 50px;
  }
  
  .main-bg {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .join-left {
    min-width: auto;
  }
  
  .video-view {
    max-width: 100%;
    width: 100%;
  }
  
  .device-controls {
    flex-direction: column;
    gap: 8px;
  }
  
  .join-right {
    min-width: auto;
    max-width: 100%;
    padding: 10px;
  }
  
  input[type="text"] {
    font-size: 16px; /* Prevents zoom on iOS */
    max-width: 100%;
  }
  
  .btn {
    width: 100%;
    font-size: 14px;
    padding: 11px 20px;
  }
  
  /* Main call page mobile */
  .grid-page .row {
    padding: 8px 16px;
    height: 56px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  
  .toolbar-controls {
    gap: 2px;
  }
  
  .btn-outline-light,
  .toolbar-btn {
    width: 36px;
    height: 36px;
  }
  
  .material-icons {
    font-size: 18px;
  }
  
  #meetingid {
    min-width: 150px;
    font-size: 12px;
  }
  
  /* #btnCopy {
    padding: 6px 8px;
    font-size: 12px;
  } */
  
  .vertical-line {
    margin: 0 6px;
  }
  
  /* Video grid mobile optimizations */
  #videoContainer {
    gap: 1px;
    padding: 1px;
  }
  
  .video-frame-container:hover {
    transform: none; /* Disable hover effects on mobile */
  }
  
  /* Side panels mobile */
  .participant-wrapper.open,
  .chat-wrapper.open {
    width: 280px;
  }
}

/* Enhanced Small phones (up to 480px) */
@media (max-width: 480px) {
  #joinPage {
    padding: 8px;
  }
  
  .logo-section h1 {
    font-size: 1.6rem;
  }
  
  .logo-section p {
    font-size: 0.9rem;
  }
  
  .video-view {
    border-radius: 8px;
  }
  
  #micButton,
  #camButton {
    width: 40px;
    height: 40px;
  }
  
  .device-controls .btn-group {
    margin-bottom: 5px;
  }
  
  .media-permission {
    font-size: 11px;
    padding: 6px 8px;
  }
  
  /* Very compact toolbar */
  .grid-page .row {
    padding: 6px 12px;
    height: 52px;
  }
  
  .btn-outline-light,
  .toolbar-btn {
    width: 32px;
    height: 32px;
  }
  
  .material-icons {
    font-size: 16px;
  }
  
  #meetingid {
    min-width: 120px;
    font-size: 11px;
  }
  
  /* #btnCopy {
    padding: 4px 6px;
  } */
  
  .vertical-line {
    margin: 0 4px;
    height: 20px;
  }
  
  /* Side panels very small screens */
  .participant-wrapper.open,
  .chat-wrapper.open {
    width: 260px;
  }
}

/* Enhanced Extra small phones (up to 360px) */
@media (max-width: 360px) {
  .logo-section h1 {
    font-size: 1.4rem;
  }
  
  .video-view {
    border-radius: 6px;
  }
  
  input[type="text"] {
    height: 45px;
    font-size: 14px;
  }
  
  .btn {
    font-size: 13px;
    padding: 10px 15px;
  }
  
  .grid-page .row {
    height: 48px;
    padding: 4px 8px;
  }
  
  /* #meetingid { */
    /* width: 100px;
    font-size: 10px;
  } */
  
  .btn-outline-light,
  .toolbar-btn {
    width: 28px;
    height: 28px;
  }
  
  .material-icons {
    font-size: 14px;
  }
  
  .participant-wrapper.open,
  .chat-wrapper.open {
    width: 240px;
  }
  
  .btn-danger {
    width: 32px;
    height: 28px;
  }
}

/* Portrait orientation optimizations */
@media (orientation: portrait) and (max-width: 767px) {
  .main-bg {
    flex-direction: column;
  }
  
  .video-view {
    aspect-ratio: 4/3; /* Better for portrait screens */
  }
}

/* Landscape orientation optimizations */
@media (orientation: landscape) and (max-height: 500px) {
  #joinPage {
    overflow-y: auto;
  }
  
  .logo-section {
    margin-bottom: 0.5rem;
  }
  
  .logo-section h1 {
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
  }
  
  .video-view {
    height: 150px;
    max-width: 250px;
  }
  
  .main-bg {
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .join-left,
  .join-right {
    flex: 1;
  }
  
  .grid-page .row {
    height: 48px;
    padding: 6px 12px;
  }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .video-frame {
    image-rendering: crisp-edges;
  }
  
  .logo-section img {
    image-rendering: -webkit-optimize-contrast;
  }
  
  .material-icons {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Enhanced High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #8ab4f8;
    --text-primary: #ffffff;
    --text-secondary: #dadce0;
  }
  
  .btn-outline-light,
  .toolbar-btn {
    border-width: 2px;
  }
}

/* Enhanced Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .spin,
  .btn-recording {
    animation: none;
  }
  
  .video-frame-container:hover {
    transform: none;
  }
  
  .btn-outline-light:hover,
  .toolbar-btn:hover {
    transform: none;
  }
}

/* Dark mode support (already optimized for dark) */
@media (prefers-color-scheme: dark) {
  /* Already optimized for dark mode */
  body {
    color-scheme: dark;
  }
}

/* Light mode override (if needed) */
@media (prefers-color-scheme: light) {
  :root {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --toolbar-bg: #ffffff;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --hover-bg: #f1f3f4;
  }
  
  body {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
  }
  
  .video-view {
    background: var(--secondary-bg);
  }
}

/* Print styles (hide video elements) */
@media print {
  #joinPage,
  .grid-page,
  video,
  .video-frame {
    display: none !important;
  }
  
  body::before {
    content: "Video Call Interface - Not available for printing";
    display: block;
    text-align: center;
    padding: 50px;
    font-size: 18px;
  }
}

/* Enhanced Focus management for accessibility */
.btn-outline-light:focus-visible,
.toolbar-btn:focus-visible,
.btn-danger:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(90, 107, 255, 0.2);
}

/* Enhanced keyboard navigation */
.toolbar-controls button:focus {
  z-index: 1;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Enhanced loading spinner */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Enhanced notification badges */
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--danger-color);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid var(--toolbar-bg);
}

/* Enhanced ripple effect for buttons */
.btn-outline-light::before,
.toolbar-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
  z-index: 0;
}

.btn-outline-light:active::before,
.toolbar-btn:active::before {
  width: 40px;
  height: 40px;
}

.btn-outline-light .material-icons,
.toolbar-btn .material-icons {
  position: relative;
  z-index: 1;
}

/* Enhanced connection status indicators */
.connection-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.connection-good {
  background-color: rgba(52, 168, 83, 0.1);
  color: var(--success-color);
}

.connection-poor {
  background-color: rgba(251, 188, 4, 0.1);
  color: var(--warning-color);
}

.connection-bad {
  background-color: rgba(234, 67, 53, 0.1);
  color: var(--danger-color);
}

/* Enhanced video quality indicators */
.quality-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 6px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  z-index: 2;
}

/* Enhanced participant status */
.participant-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
}

.participant-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 500;
  font-size: 14px;
}

.participant-info {
  flex: 1;
  min-width: 0;
}

.participant-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  truncate: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.participant-indicators {
  display: flex;
  gap: 4px;
}

.status-indicator {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-muted {
  background-color: var(--danger-color);
  color: white;
}

.status-unmuted {
  background-color: var(--success-color);
  color: white;
}

/* Enhanced chat styles */
.chat-wrapper-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.chat-message {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-message-content {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.message-box {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

.message-box input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--primary-bg);
  color: var(--text-primary);
  font-size: 14px;
}

.message-box button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

/* Recording buttons */
#btnStartRecording {
  border: 1px solid #f44336;
  color: #f44336;
}

#btnStartRecording:hover {
  background-color: #f44336;
  color: white;
}

