:root {
    --radius: 0.65rem;
    --background: oklch(1 0 0);
    --foreground: oklch(0.145 0 0);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.145 0 0);
    --popover: oklch(1 0 0);
    --popover-foreground: oklch(0.145 0 0);
    --primary: oklch(0.205 0 0);
    --primary-foreground: oklch(0.985 0 0);
    --secondary: oklch(0.97 0 0);
    --secondary-foreground: oklch(0.205 0 0);
    --muted: oklch(0.97 0 0);
    --muted-foreground: oklch(0.556 0 0);
    --accent: oklch(0.97 0 0);
    --accent-foreground: oklch(0.205 0 0);
    --destructive: oklch(0.577 0.245 27.325);
    --border: oklch(0.922 0 0);
    --input: oklch(0.922 0 0);
    --ring: oklch(0.708 0 0);
    --chart-1: oklch(0.646 0.222 41.116);
    --chart-2: oklch(0.6 0.118 184.704);
    --chart-3: oklch(0.398 0.07 227.392);
    --chart-4: oklch(0.828 0.189 84.429);
    --chart-5: oklch(0.769 0.188 70.08);
    --sidebar: oklch(0.985 0 0);
    --sidebar-foreground: oklch(0.145 0 0);
    --sidebar-primary: oklch(0.205 0 0);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.97 0 0);
    --sidebar-accent-foreground: oklch(0.205 0 0);
    --sidebar-border: oklch(0.922 0 0);
    --sidebar-ring: oklch(0.708 0 0);
  }
  
  .dark {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.205 0 0);
    --card-foreground: oklch(0.985 0 0);
    --popover: oklch(0.205 0 0);
    --popover-foreground: oklch(0.985 0 0);
    --primary: oklch(0.922 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --secondary: oklch(0.269 0 0);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --accent: oklch(0.269 0 0);
    --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.556 0 0);
    --chart-1: oklch(0.488 0.243 264.376);
    --chart-2: oklch(0.696 0.17 162.48);
    --chart-3: oklch(0.769 0.188 70.08);
    --chart-4: oklch(0.627 0.265 303.9);
    --chart-5: oklch(0.645 0.246 16.439);
    --sidebar: oklch(0.205 0 0);
    --sidebar-foreground: oklch(0.985 0 0);
    --sidebar-primary: oklch(0.488 0.243 264.376);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.269 0 0);
    --sidebar-accent-foreground: oklch(0.985 0 0);
    --sidebar-border: oklch(1 0 0 / 10%);
    --sidebar-ring: oklch(0.556 0 0);
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }
  
  body {
    background: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  
  .container {
    width: 100%;
    max-width: 500px;
    background: var(--card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
  }
  
  header {
    text-align: center;
    margin-bottom: 30px;
  }
  
  h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--chart-1), var(--chart-4));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  
  .subtitle {
    color: var(--muted-foreground);
    font-size: 1.1rem;
  }
  
  .card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
  }
  
  .form-group {
    margin-bottom: 20px;
  }
  
  label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--foreground);
  }
  
  input, button {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    border: none;
    font-size: 1rem;
    transition: all 0.3s ease;
  }
  
  input {
    background: var(--input);
    color: var(--foreground);
    border: 1px solid var(--border);
  }
  
  input:focus {
    outline: none;
    border-color: var(--chart-1);
    box-shadow: 0 0 0 2px var(--ring);
  }
  
  input::placeholder {
    color: var(--muted-foreground);
  }
  
  button {
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    border: 1px solid transparent;
  }
  
  button:hover {
    background: var(--chart-1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  
  button:active {
    transform: translateY(0);
  }
  
  button:disabled {
    background: var(--muted);
    color: var(--muted-foreground);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }
  
  .btn-danger {
    background: var(--destructive);
    color: white;
  }
  
  .btn-danger:hover {
    background: oklch(0.65 0.25 27.325);
  }
  
  .btn-success {
    background: var(--chart-2);
    color: white;
  }
  
  .btn-success:hover {
    background: oklch(0.55 0.13 184.704);
  }
  
  .btn-warning {
    background: var(--chart-5);
    color: white;
  }
  
  .btn-warning:hover {
    background: oklch(0.65 0.2 70.08);
  }
  
  .status {
    text-align: center;
    padding: 15px;
    border-radius: var(--radius);
    margin: 15px 0;
    font-weight: 500;
    border: 1px solid;
  }
  
  .status.connected {
    background: color-mix(in oklch, var(--chart-2), transparent 80%);
    border-color: var(--chart-2);
    color: var(--chart-2);
  }
  
  .status.connecting {
    background: color-mix(in oklch, var(--chart-5), transparent 80%);
    border-color: var(--chart-5);
    color: var(--chart-5);
  }
  
  .status.waiting {
    background: color-mix(in oklch, var(--muted-foreground), transparent 80%);
    border-color: var(--muted-foreground);
    color: var(--muted-foreground);
  }
  
  .status.error {
    background: color-mix(in oklch, var(--destructive), transparent 80%);
    border-color: var(--destructive);
    color: var(--destructive);
  }
  
  .code-display {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 5px;
    margin: 20px 0;
    padding: 15px;
    background: var(--muted);
    border-radius: var(--radius);
    user-select: none;
    border: 1px solid var(--border);
    color: var(--foreground);
  }
  
  .controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
  }
  
  .controls button {
    flex: 1;
  }
  
  .hidden {
    display: none;
  }
  
  .instructions {
    margin-top: 25px;
    padding: 15px;
    background: var(--muted);
    border-radius: var(--radius);
    font-size: 0.9rem;
    border: 1px solid var(--border);
  }
  
  .instructions h3 {
    margin-bottom: 10px;
    color: var(--chart-1);
  }
  
  .instructions ol {
    padding-left: 20px;
  }
  
  .instructions li {
    margin-bottom: 8px;
    color: var(--muted-foreground);
  }
  
  .call-active .call-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  .audio-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
  }
  
  .avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--chart-1), var(--chart-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
  }
  
  .call-timer {
    text-align: center;
    font-size: 1.2rem;
    margin: 10px 0;
    font-weight: bold;
    color: var(--foreground);
  }
  
  .participants-list {
    margin: 15px 0;
  }
  
  .participant {
    display: flex;
    align-items: center;
    padding: 10px;
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--border);
  }
  
  .participant-you {
    background: color-mix(in oklch, var(--chart-2), transparent 90%);
    border-left: 3px solid var(--chart-2);
  }
  
  .participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 0.8rem;
    color: var(--primary-foreground);
  }
  
  .participant-name {
    flex: 1;
    color: var(--foreground);
  }
  
  .participant-status {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    min-width: 80px;
  }
  
  .loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--muted-foreground);
    border-radius: 50%;
    border-top-color: var(--foreground);
    animation: spin 1s ease-in-out infinite;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  .status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
  }
  
  .status-indicator.online {
    background-color: var(--chart-2);
  }
  
  .status-indicator.away {
    background-color: var(--chart-5);
  }
  
  .status-indicator.offline {
    background-color: var(--muted-foreground);
  }
  
  .kick-btn {
    background: transparent;
    border: none;
    color: var(--destructive);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    margin-left: 10px;
    width: auto;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
  }
  
  .kick-btn:hover {
    background: color-mix(in oklch, var(--destructive), transparent 90%);
  }
  
  .participant {
    display: flex;
    align-items: center;
    padding: 10px;
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 8px;
    position: relative;
    border: 1px solid var(--border);
  }
  
  .participant-name {
    flex: 1;
    margin-right: 10px;
  }
  
  .participant-status {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    min-width: 80px;
    color: var(--muted-foreground);
  }
  
  /* Real Call Interface Styles */
  #call-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  
  .call-interface {
    width: 100%;
    max-width: 400px;
    padding: 30px 20px;
    text-align: center;
    color: var(--foreground);
  }
  
  .caller-info {
    margin-bottom: 40px;
  }
  
  .avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--chart-1), var(--chart-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    color: white;
  }
  
  .caller-details h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--foreground);
  }
  
  .call-status {
    font-size: 1rem;
    color: var(--muted-foreground);
  }
  
  .call-timer-large {
    font-size: 1.5rem;
    margin: 20px 0 40px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--foreground);
  }
  
  .call-controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
  }
  
  .call-control-btn {
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
  }
  
  .call-control-btn:hover {
    background: var(--accent);
    transform: scale(1.05);
  }
  
  .call-control-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
  }
  
  .control-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }
  
  .call-control-btn span {
    font-size: 0.7rem;
    margin-top: 5px;
  }
  
  .end-call-btn {
    background: var(--destructive);
    border: none;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
    box-shadow: 0 4px 15px color-mix(in oklch, var(--destructive), transparent 60%);
  }
  
  .end-call-btn:hover {
    background: oklch(0.65 0.25 27.325);
    transform: scale(1.05);
  }
  
  .end-call-icon {
    font-size: 1.8rem;
    transform: rotate(135deg);
  }
  
  .room-name-section {
    margin: 20px 0;
    padding: 15px;
    background: var(--muted);
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }
  
  .room-name-section input {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--input);
    color: var(--foreground);
    margin-bottom: 10px;
  }
  
  .room-name-section button {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius);
    border: none;
    background: var(--primary);
    color: var(--primary-foreground);
    cursor: pointer;
    transition: background 0.3s ease;
  }
  
  .room-name-section button:hover {
    background: var(--chart-1);
  }
  
  .participants-list-call {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
  }
  
  .participant-call {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border-left: 3px solid var(--primary);
  }
  
  .participant-call.you {
    background: color-mix(in oklch, var(--chart-2), transparent 90%);
    border-left-color: var(--chart-2);
  }
  
  .participant-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary-foreground);
  }
  
  .participant-details {
    flex: 1;
    text-align: left;
  }
  
  .participant-name {
    font-weight: 500;
    margin-bottom: 2px;
    color: var(--foreground);
  }
  
  .participant-status-call {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
  }
  
  .status-indicator-call {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 5px;
  }
  
  .status-indicator-call.online {
    background-color: var(--chart-2);
  }
  
  .status-indicator-call.away {
    background-color: var(--chart-5);
  }
  
  .status-indicator-call.offline {
    background-color: var(--muted-foreground);
  }
  
  /* Animation for incoming call */
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
  
  .call-pulse {
    animation: pulse 2s infinite;
  }
  
  /* Theme Toggle Button */
  .theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .theme-toggle:hover {
    background: var(--accent);
    transform: scale(1.1);
  }
  
  /* Responsive adjustments */
  @media (max-width: 600px) {
    .container {
      padding: 20px;
    }
    
    h1 {
      font-size: 1.8rem;
    }
    
    .code-display {
      font-size: 2rem;
    }
    
    .controls {
      flex-direction: column;
    }
    
    .theme-toggle {
      top: 10px;
      right: 10px;
      width: 40px;
      height: 40px;
    }
  }
  
  @media (max-width: 480px) {
    .call-controls-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 15px;
    }
    
    .call-control-btn {
      width: 65px;
      height: 65px;
    }
    
    .avatar-large {
      width: 100px;
      height: 100px;
      font-size: 3rem;
    }
    
    .caller-details h2 {
      font-size: 1.5rem;
    }
  }
  
  /* Ensure dark mode is applied to body */
  body.dark {
    background: var(--background);
    color: var(--foreground);
  }