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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.btn-primary {
  background: #4CAF50;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #45a049;
}

.btn-secondary {
  background: #2196F3;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #0b7dda;
}

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

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

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

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

/* Form elements */
input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: #4CAF50;
}

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

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

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Error messages */
.error-message {
  display: none;
  padding: 12px;
  background: #f44336;
  color: white;
  border-radius: 8px;
  margin-top: 16px;
  text-align: center;
  font-weight: 600;
}

.status-message {
  display: none;
  padding: 12px;
  background: #2196F3;
  color: white;
  border-radius: 8px;
  margin-top: 16px;
  text-align: center;
  font-weight: 600;
}

/* Utility */
.button-group {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 2px solid #ddd;
}

.divider span {
  padding: 0 16px;
  color: #666;
  font-weight: 600;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
    /* Improve touch target size */
    min-height: 44px;
  }

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

  .btn-large {
    padding: 14px 28px;
    font-size: 16px;
  }

  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  select,
  textarea {
    /* Prevent zoom on iOS when focusing inputs */
    font-size: 16px;
    padding: 12px;
    /* Improve touch target */
    min-height: 44px;
  }

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

  .card {
    padding: 20px;
  }

  .button-group {
    gap: 10px;
  }

  /* Make buttons in button groups stack on mobile */
  .button-group.stack-mobile {
    flex-direction: column;
  }

  .button-group.stack-mobile .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 12px;
  }

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

  .btn-large {
    padding: 12px 24px;
    font-size: 15px;
  }

  .card {
    padding: 16px;
  }

  .error-message,
  .status-message {
    padding: 10px;
    font-size: 14px;
  }
}

/* Connection Status Indicator */
.connection-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideInDown 0.3s ease;
}

.connection-indicator.connected {
  background: #4CAF50;
  color: white;
}

.connection-indicator.disconnected {
  background: #f44336;
  color: white;
  animation: pulse 1.5s ease-in-out infinite;
}

.connection-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
}

.connection-indicator.disconnected .connection-dot {
  animation: blink 1s ease-in-out infinite;
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Mobile adjustments for connection indicator */
@media (max-width: 768px) {
  .connection-indicator {
    top: 10px;
    right: 10px;
    left: 10px;
    padding: 10px 16px;
    font-size: 13px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .connection-indicator {
    font-size: 12px;
    padding: 8px 12px;
  }

  .connection-dot {
    width: 10px;
    height: 10px;
  }
}
