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

  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
  }

  .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
  }

  .app-header {
    text-align: center;
    margin-bottom: 60px;
  }

  .app-title {
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
  }

  .app-subtitle {
    font-size: 0.9rem;
    color: #8b8b8b;
    font-weight: 400;
  }

  .chat-card {
    background: #16213e;
    border-radius: 16px;
    padding: 32px;
    border: 1px solid #0f3460;
    max-width: 400px;
    margin: 0 auto;
  }

  .main-chat-content {
    /* Expand to wider layout when in chat */
    max-width: 600px;
    margin: 0 auto;
  }

  .join-section {
    display: block;
  }

  .chat-section {
    display: none;
  }

  .input-group {
    margin-bottom: 24px;
  }

  .input-label {
    display: block;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 0.9rem;
  }

  .name-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid #0f3460;
    border-radius: 8px;
    background: #0f3460;
    transition: all 0.2s ease;
    font-family: inherit;
  }

  .name-input:focus {
    outline: none;
    border-color: #22c55e;
    background: #1a1a2e;
  }

  .name-input::placeholder {
    color: #8b8b8b;
  }

  .join-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 500;
    color: white;
    background: #22c55e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
  }

  .join-btn:hover {
    background: #16a34a;
  }

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

  .visualizer {
    width: 64px;
    height: 64px;
    background: #e94560;
    border-radius: 50%;
    margin: 24px auto;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none; /* No permanent shadow, only when speaking */
    cursor: pointer;
  }

  .visualizer:hover {
    background: #d73652;
  }

  .visualizer.muted {
    background: #6b7280;
  }

  .visualizer.muted:hover {
    background: #4b5563;
  }

  .visualizer-icon {
    color: white;
    font-size: 20px;
  }

  .status {
    text-align: center;
    margin: 16px 0 24px;
    font-weight: 400;
    color: #8b8b8b;
    font-size: 0.9rem;
  }

  .participants {
    margin-top: 32px;
  }

  .participants-title {
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .participant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .participant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #0f3460;
    border-radius: 8px;
    border: 1px solid rgba(233, 69, 96, 0.1);
  }

  .participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  }

  .participant-info {
    flex: 1;
  }

  .participant-name {
    font-weight: 500;
    color: #ffffff;
    font-size: 0.9rem;
  }

  .participant-indicators {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }

  .mute-indicator {
    color: #e94560;
    font-size: 1rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(233, 69, 96, 0.1);
    border-radius: 50%;
    border: 1px solid rgba(233, 69, 96, 0.3);
  }

  .screen-indicator {
    color: #22c55e;
    font-size: 1rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    border: 1px solid rgba(34, 197, 94, 0.3);
  }

  .audio-controls {
    display: none;
  }

  .chat-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
  }

  .screen-share-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    background: #22c55e;
    border: 1px solid #22c55e;  
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .screen-share-btn:hover {
    background: #16a34a;
  }

  .screen-share-btn.sharing {
    background: #f59e0b;
    border-color: #f59e0b;
  }

  .screen-share-btn.sharing:hover {
    background: #d97706;
  }

  .sound-toggle-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    background: #8b5cf6;
    border: 1px solid #8b5cf6;  
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .sound-toggle-btn:hover {
    background: #7c3aed;
  }

  .sound-toggle-btn .fa-volume-mute {
    color: #ef4444;
  }

  .chat-toggle-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    background: #3b82f6;
    border: 1px solid #3b82f6;  
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
  }

  .chat-toggle-btn:hover {
    background: #2563eb;
  }

  .chat-toggle-btn.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
  }

  .unread-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    border: 2px solid #16213e;
  }

  .screens-area {
    margin-top: 24px;
    margin-bottom: 24px;
  }

  .screens-title {
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .screens-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .screen-item {
    background: #0f3460;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(34, 197, 94, 0.2);
  }

  .screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    position: relative;
  }

  .screen-info {
    flex: 1;
  }

  .screen-sharer-name {
    font-weight: 500;
    color: #ffffff;
    font-size: 0.9rem;
  }

  .fullscreen-btn {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    color: #22c55e;
    cursor: pointer;
    padding: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .fullscreen-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    color: #16a34a;
    transform: scale(1.05);
  }

  .fullscreen-btn:active {
    transform: scale(0.95);
  }

  .screen-video {
    width: 100%;
    border-radius: 6px;
    background: #000;
    max-height: 300px;
    min-height: 200px;
    object-fit: contain;
    display: block;
  }

  /* Fullscreen video styling */
  .screen-video:fullscreen {
    width: 100vw;
    height: 100vh;
    max-height: none;
    min-height: none;
    border-radius: 0;
    object-fit: contain;
    background: #000;
  }

  .screen-video:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-height: none;
    min-height: none;
    border-radius: 0;
    object-fit: contain;
    background: #000;
  }

  .screen-video:-moz-full-screen {
    width: 100vw;
    height: 100vh;
    max-height: none;
    min-height: none;
    border-radius: 0;
    object-fit: contain;
    background: #000;
  }

  /* Chat Window Styles */
  .chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 400px;
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #0f3460;
    background: #1a2342;
    border-radius: 12px 12px 0 0;
  }

  .chat-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .chat-close-btn {
    background: transparent;
    border: none;
    color: #8b8b8b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 1rem;
  }

  .chat-close-btn:hover {
    background: #0f3460;
    color: #ffffff;
  }

  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

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

  .chat-message.own {
    align-items: flex-end;
  }

  .chat-message.other {
    align-items: flex-start;
  }

  .message-sender {
    font-size: 0.75rem;
    color: #8b8b8b;
    font-weight: 500;
  }

  .message-content {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    word-wrap: break-word;
    position: relative;
  }

  .chat-message.own .message-content {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
  }

  .chat-message.other .message-content {
    background: #0f3460;
    color: #ffffff;
    border-bottom-left-radius: 4px;
  }

  .message-time {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 2px;
  }

  .chat-input-container {
    display: flex;
    padding: 12px;
    border-top: 1px solid #0f3460;
    gap: 8px;
    background: #1a2342;
    border-radius: 0 0 12px 12px;
    align-items: center;
  }

  .file-btn {
    background: #6b7280;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    padding: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .file-btn:hover {
    background: #4b5563;
    transform: scale(1.05);
  }

  .file-btn:active {
    transform: scale(0.95);
  }

  .chat-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.9rem;
    border: 1px solid #0f3460;
    border-radius: 20px;
    background: #16213e;
    color: #ffffff;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
  }

  .chat-input:focus {
    border-color: #3b82f6;
    background: #1a2342;
  }

  .chat-input::placeholder {
    color: #8b8b8b;
  }

  .send-btn {
    background: #3b82f6;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    padding: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .send-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
  }

  .send-btn:active {
    transform: scale(0.95);
  }

  .send-btn:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
  }

  /* System messages */
  .system-message {
    text-align: center;
    color: #8b8b8b;
    font-size: 0.8rem;
    font-style: italic;
    margin: 8px 0;
    padding: 4px 8px;
    background: rgba(139, 139, 139, 0.1);
    border-radius: 8px;
  }

  /* Chat link styles */
  .chat-link {
    color: #60a5fa;
    text-decoration: underline;
    transition: color 0.2s ease;
    word-break: break-all;
  }

  .chat-link:hover {
    color: #93c5fd;
    text-decoration: none;
  }

  .chat-link:visited {
    color: #a78bfa;
  }

  .chat-message.own .chat-link {
    color: #dbeafe;
  }

  .chat-message.own .chat-link:hover {
    color: #ffffff;
  }

  .chat-message.own .chat-link:visited {
    color: #e0e7ff;
  }

  /* Image message styles */
  .image-message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 300px;
  }

  .chat-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    object-fit: cover;
    background: #000;
  }

  .chat-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .image-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #8b8b8b;
    padding: 4px 0;
  }

  .image-info i {
    font-size: 0.9rem;
  }

  /* Image modal styles */
  .image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
  }

  .image-modal.show {
    opacity: 1;
  }

  .image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
  }

  .image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    padding: 8px;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
  }

  .image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
  }

  .image-modal-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    object-fit: contain;
  }

  .image-modal-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
  }

  /* File message styles */
  .file-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(107, 114, 128, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.2);
    border-radius: 8px;
    max-width: 350px;
    transition: all 0.2s ease;
  }

  .file-message:hover {
    background: rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.3);
  }

  .file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-size: 1.2rem;
    flex-shrink: 0;
  }

  .file-icon .fa-file-pdf { color: #dc2626; }
  .file-icon .fa-file-word { color: #2563eb; }
  .file-icon .fa-file-excel { color: #059669; }
  .file-icon .fa-file-powerpoint { color: #ea580c; }
  .file-icon .fa-file-archive { color: #7c2d12; }
  .file-icon .fa-file-audio { color: #7c3aed; }
  .file-icon .fa-file-video { color: #dc2626; }
  .file-icon .fa-file-code { color: #059669; }
  .file-icon .fa-file-alt { color: #6b7280; }

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

  .file-name {
    font-weight: 500;
    color: #ffffff;
    font-size: 0.9rem;
    word-break: break-all;
    line-height: 1.3;
  }

  .file-size {
    font-size: 0.8rem;
    color: #8b8b8b;
    margin-top: 2px;
  }

  .file-download-btn {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    color: #22c55e;
    cursor: pointer;
    padding: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-shrink: 0;
  }

  .file-download-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    color: #16a34a;
    transform: scale(1.05);
  }

  .file-download-btn:active {
    transform: scale(0.95);
  }

  /* Mobile responsiveness for images */
  @media (max-width: 480px) {
    .image-message {
      max-width: 250px;
    }
    
    .chat-image {
      max-height: 150px;
    }
    
    .image-modal-close {
      top: -35px;
      right: -5px;
    }

    .file-message {
      max-width: 280px;
    }

    .file-name {
      font-size: 0.85rem;
    }
  }

  /* Mobile responsiveness for chat */
  @media (max-width: 480px) {
    .chat-window {
      bottom: 10px;
      right: 10px;
      left: 10px;
      width: auto;
      height: 350px;
    }
  }

  .leave-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    background: #e94560;
    border: 1px solid #e94560;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 24px;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .leave-btn:hover {
    background: #d73652;
    color: #ffffff;
  }

  @media (max-width: 480px) {
    .container {
      padding: 20px 16px;
    }
    
    .app-title {
      font-size: 1.8rem;
    }
    
    .chat-card {
      padding: 24px 20px;
    }
    
    .name-input, .join-btn {
      font-size: 16px; /* Prevents zoom on iOS */
    }
  }