/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

/* Main Page Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  background: white;
  border-radius: 12px;
  padding: 20px 30px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 2rem;
  color: #667eea;
}

.header-controls {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.primary-btn {
  background: #667eea;
  color: white;
}

.primary-btn:hover {
  background: #5568d3;
}

.danger-btn {
  background: #e74c3c;
  color: white;
}

.danger-btn:hover {
  background: #c0392b;
}

.icon-btn {
  background: #f0f0f0;
  color: #333;
  padding: 10px;
  font-size: 1.2rem;
}

.icon-btn:hover {
  background: #e0e0e0;
}

.control-btn {
  background: #f0f0f0;
  color: #333;
  padding: 12px;
  font-size: 1.2rem;
  width: 100%;
  margin-bottom: 10px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.control-btn:hover {
  background: #e0e0e0;
}

.control-btn.active {
  background: #2ecc71;
  color: white;
}

.control-btn.recording {
  background: #e74c3c;
  color: white;
  animation: pulse 2s infinite;
}

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

/* Main Content */
.main-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.rooms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.rooms-header h2 {
  color: #667eea;
}

/* Rooms Container */
.rooms-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.room-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 15px;
  transition: all 0.3s ease;
}

.room-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.room-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-name {
  color: #333;
  font-size: 1.3rem;
}

.room-id {
  color: #666;
  font-size: 0.9rem;
}

.room-participants {
  color: #888;
  font-size: 0.9rem;
}

.participant-count {
  font-weight: bold;
  color: #667eea;
}

.recording-badge {
  display: inline-block;
  background: #e74c3c;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.join-room-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.join-room-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.no-rooms {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 1.1rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px;
  color: white;
  opacity: 0.9;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #667eea;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
  outline: none;
  border-color: #667eea;
}

.form-group input[type="checkbox"] {
  margin-right: 8px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cancel-btn {
  background: #e0e0e0;
  color: #333;
}

/* Auth Modal */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.auth-modal-content {
  background: white;
  border-radius: 12px;
  padding: 40px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.auth-modal-content h2 {
  margin-bottom: 30px;
  color: #667eea;
}

.auth-modal-content button {
  width: 100%;
  margin-top: 10px;
}

/* Room Page */
.room-page {
  padding: 20px;
}

.room-container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.room-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.room-header .room-name {
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.room-header .room-id {
  font-size: 0.9rem;
  opacity: 0.9;
}

.room-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.connection-status {
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

.connection-status.connected {
  background: rgba(46, 204, 113, 0.9);
}

.connection-status.disconnected {
  background: rgba(231, 76, 60, 0.9);
}

.room-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 200px);
}

/* Sidebar */
.sidebar {
  background: #f8f9fa;
  padding: 20px;
  border-right: 1px solid #e0e0e0;
}

.sidebar-section {
  margin-bottom: 30px;
}

.sidebar-section h3 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-item {
  background: white;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.user-item:hover {
  transform: translateX(5px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-item.me {
  background: #e8f4fd;
  border-left: 4px solid #667eea;
}

.user-name {
  font-weight: 500;
  color: #333;
}

.user-status {
  width: 10px;
  height: 10px;
  background: #2ecc71;
  border-radius: 50%;
}

/* Main Area */
.main-area {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

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

.chat-message {
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.message-time {
  font-size: 0.8rem;
  color: #999;
  min-width: 50px;
}

.message-author {
  font-weight: 600;
  color: #667eea;
  white-space: nowrap;
}

.message-text {
  color: #333;
  word-break: break-word;
}

.chat-input-container {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: white;
  border-top: 1px solid #e0e0e0;
}

.chat-input {
  flex: 1;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.chat-input:focus {
  outline: none;
  border-color: #667eea;
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #333;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease;
  z-index: 1000;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .room-content {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .rooms-container {
    grid-template-columns: 1fr;
  }
  
  .header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .rooms-header {
    flex-direction: column;
    gap: 15px;
  }
}