/**
 * P2P Chat Styles
 * Modern, responsive design with dark/light mode support
 */

:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #8b5cf6;
  --success-color: #22c55e;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-hover: #475569;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-color: #334155;
  --shadow-color: rgba(0, 0, 0, 0.3);
  
  --message-me: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --message-other: #334155;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --transition: all 0.2s ease;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-hover: #cbd5e1;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    --message-other: #e2e8f0;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Screen Layout */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Auth Screen */
#auth-screen {
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* Join Screen */
#join-screen {
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.join-container {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.logo {
  margin-bottom: 40px;
}

.logo-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.logo h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-secondary);
  margin-top: 8px;
}

.join-form {
  background: var(--bg-secondary);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px var(--shadow-color);
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group small {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.features {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.feature {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.feature-icon {
  font-size: 18px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

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

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

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

.btn-success:hover:not(:disabled) {
  background: #16a34a;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-large {
  padding: 16px 32px;
  font-size: 17px;
}

.btn-icon {
  padding: 10px;
  font-size: 20px;
  background: transparent;
}

/* HTTPS Notice */
.https-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--warning-color);
  color: #000;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.https-notice.hidden {
  display: none;
}

.https-notice .btn-icon {
  color: #000;
  padding: 4px;
  font-size: 16px;
}

/* Chat Screen */
#chat-screen {
  height: 100vh;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-info {
  display: flex;
  gap: 24px;
}

.room-info, .user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-label, .user-label {
  color: var(--text-muted);
  font-size: 13px;
}

.room-name, .user-name {
  font-weight: 600;
  color: var(--primary-color);
}

/* Mobile Peer Toggle Button */
#mobile-peer-toggle {
  position: relative;
  display: none;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.hamburger-icon {
  font-size: 20px;
  line-height: 1;
}

.peer-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary-color);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.peer-badge.hidden {
  display: none;
}

/* Mobile Sidebar Overlay */
.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile Sidebar Close Button */
#mobile-sidebar-close {
  display: none;
  color: var(--text-secondary);
  padding: 4px;
}

#mobile-sidebar-close:hover {
  color: var(--text-primary);
}

.chat-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.peer-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.peer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.peer-item:hover {
  background: var(--bg-hover);
}

.peer-item.active {
  background: var(--primary-color);
}

.group-chat-item {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
  padding-bottom: 15px;
}

.group-avatar {
  background: linear-gradient(135deg, #6e8efb, #a777e3) !important;
}

.peer-item.active .peer-name {
  color: white;
}

.peer-item.active .peer-status {
  color: rgba(255, 255, 255, 0.7);
}

.peer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 16px;
}

.peer-info {
  flex: 1;
}

.peer-name {
  font-weight: 500;
  color: var(--text-primary);
}

.peer-status {
  font-size: 12px;
  color: var(--text-muted);
}

.peer-item.connected .peer-status {
  color: var(--success-color);
}

.peer-item.connecting .peer-status {
  color: var(--warning-color);
}

/* Main Chat Area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.video-container {
  position: relative;
  width: 100%;
  height: auto;
  max-height: 400px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.remote-video {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  display: block;
}

.local-video {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 120px;
  height: auto;
  max-height: 90px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  border: 2px solid rgba(255, 255, 255, 0.3);
  z-index: 10;
}

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

.chat-area-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.call-controls {
  display: flex;
  gap: 8px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-messages.drag-over {
  background: rgba(99, 102, 241, 0.1);
  border: 2px dashed var(--primary-color);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.empty-state .hint {
  font-size: 13px;
  margin-top: 8px;
}

/* Messages */
.message {
  display: flex;
  max-width: 70%;
}

.message-me {
  align-self: flex-end;
}

.message-other {
  align-self: flex-start;
}

.message-system {
  align-self: center;
  text-align: center;
  padding: 8px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.message-system span {
  background: var(--bg-secondary);
  padding: 4px 12px;
  border-radius: 12px;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  word-wrap: break-word;
}

.message-me .message-bubble {
  background: var(--message-me);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-other .message-bubble {
  background: var(--message-other);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.message-sender {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.8;
}

.message-content {
  line-height: 1.5;
}

.message-content a {
  color: inherit;
  text-decoration: underline;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

.chat-image {
  max-width: 300px;
  max-height: 200px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.chat-image:hover {
  transform: scale(1.02);
}

.file-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
}

.file-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.typing-indicator {
  padding: 0 24px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.call-status {
  padding: 12px 24px;
  background: var(--bg-secondary);
  text-align: center;
  color: var(--primary-color);
  font-weight: 500;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Input Area */
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 12px;
}

/* File attachment button */
#file-btn {
  padding: 12px;
  font-size: 20px;
  flex-shrink: 0;
}

.message-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  resize: none;
  min-height: 52px;
  max-height: 150px;
  font-family: inherit;
  width: 100%;
}

/* Send button as circular icon */
#send-btn {
  width: 52px;
  height: 52px;
  min-width: 52px;
  padding: 0;
  font-size: 22px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

#send-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bg-tertiary);
}

.message-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.message-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Send button - small and compact */
#send-btn {
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  min-width: 80px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

#send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.call-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-secondary);
  padding: 40px;
  border-radius: var(--radius-lg);
  text-align: center;
  min-width: 300px;
}

.call-animation {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--success-color);
  animation: pulse-ring 2s ease-out infinite;
}

.pulse-ring:nth-child(2) {
  animation-delay: 0.5s;
}

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

.call-icon {
  font-size: 40px;
  z-index: 1;
}

.modal-content h3 {
  margin-bottom: 8px;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Mobile-only visibility helpers */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .mobile-only {
    display: flex;
  }
  
  .desktop-only {
    display: none;
  }
  
  /* Header adjustments for mobile */
  .chat-header {
    padding: 12px 16px;
  }
  
  .header-left {
    gap: 12px;
  }
  
  .header-info {
    gap: 16px;
    flex-direction: column;
    gap: 4px;
  }
  
  .room-info, .user-info {
    font-size: 13px;
  }
  
  /* Show mobile peer toggle */
  #mobile-peer-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Mobile Sidebar as slide-out drawer */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  /* Mobile sidebar header with close button */
  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
  }
  
  #mobile-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Ensure peer list takes remaining space */
  .peer-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Larger touch targets for mobile */
  .peer-item {
    padding: 16px 12px;
    min-height: 60px;
  }
  
  /* Chat main area adjustments */
  .chat-main {
    width: 100%;
  }
  
  /* Adjust message layout for mobile */
  .message {
    max-width: 90%;
  }
  
  .chat-image {
    max-width: 100%;
    max-height: 250px;
  }
  
  /* Video call adjustments */
  .video-container {
    height: 180px;
  }
  
  .local-video {
    width: 70px;
    height: 52px;
    bottom: 8px;
    right: 8px;
  }
  
  /* Input area adjustments */
  .chat-input-area {
    padding: 12px 16px;
  }

  .input-row {
    gap: 8px;
  }

  .message-input {
    padding: 14px 16px;
    font-size: 16px; /* Prevent iOS zoom */
    min-height: 52px;
  }

  /* Send button - smaller on mobile */
  #send-btn {
    padding: 12px 16px;
    font-size: 13px;
    min-width: 60px;
  }
  
  /* Call buttons stack on mobile */
  .call-buttons {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .call-buttons .btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 16px;
    font-size: 13px;
  }
  
  /* Adjust chat area header */
  .chat-area-header {
    padding: 12px 16px;
  }
  
  .chat-area-header h3 {
    font-size: 15px;
  }
  
  /* Chat messages padding */
  .chat-messages {
    padding: 16px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .header-info {
    display: none; /* Hide room/user info on very small screens */
  }
  
  .sidebar {
    width: 100%;
    max-width: 100%;
  }
  
  .message {
    max-width: 95%;
  }
  
  .btn-small {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Animation for new messages */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message {
  animation: slideIn 0.3s ease;
}

/* Authentication Styles */
.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.auth-form {
  background: var(--bg-secondary);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px var(--shadow-color);
  margin-bottom: 24px;
}

.auth-form h2 {
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-primary);
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.link-button {
  background: none;
  border: none;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}

.link-button:hover {
  text-decoration: underline;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: white;
}

.profile-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-name {
  font-weight: 600;
  color: var(--text-primary);
}

.device-management {
  margin-top: 24px;
  text-align: center;
}

/* Device Modal Styles */
.device-modal-content {
  max-width: 500px;
  width: 90%;
}

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

.modal-description {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 14px;
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.device-item.current {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
}

.device-item.loading {
  justify-content: center;
  color: var(--text-muted);
}

.device-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.device-name {
  font-weight: 600;
  color: var(--text-primary);
}

/* Network Configuration Modal Styles */
.network-modal-content {
  max-width: 550px;
  max-height: 80vh;
  overflow-y: auto;
}

.network-config {
  padding: 20px 0;
}

.network-config h4 {
  color: var(--text-primary);
  margin: 20px 0 12px 0;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.network-config h4:first-child {
  margin-top: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.status-item {
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: var(--radius-md);
}

.status-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.status-value {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.status-value.connected {
  color: var(--success-color);
}

.status-value.disconnected {
  color: var(--error-color);
}

.network-settings {
  margin-bottom: 20px;
}

.setting-item {
  margin-bottom: 16px;
}

.switch-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.switch-label input {
  display: none;
}

.switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  margin-right: 12px;
  transition: background 0.3s ease;
}

.switch-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s ease;
}

.switch-label input:checked + .switch-slider {
  background: var(--primary-color);
}

.switch-label input:checked + .switch-slider::after {
  transform: translateX(20px);
}

.network-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.device-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.device-current-badge {
  font-size: 11px;
  background: var(--primary-color);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .auth-form {
    padding: 24px;
  }
  
  .device-item {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}