/* MobileVibe Web App Styles */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: #1a1a2e;
  color: white;
  padding: 1rem;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

#user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-email {
  opacity: 0.8;
}

#logout-btn {
  color: white;
  text-decoration: none;
  opacity: 0.8;
}

#logout-btn:hover {
  opacity: 1;
}

/* Main */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Footer */
footer {
  background: #1a1a2e;
  color: white;
  text-align: center;
  padding: 1rem;
  opacity: 0.8;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #4f46e5;
  color: white;
}

.btn-primary:hover {
  background: #4338ca;
}

.btn-secondary {
  background: #e5e5e5;
  color: #333;
}

.btn-secondary:hover {
  background: #d4d4d4;
}

.btn-google {
  background: white;
  color: #333;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-google:hover {
  background: #f5f5f5;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.25rem;
}

/* Login Container */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.login-container h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.login-container p {
  color: #666;
  margin-bottom: 2rem;
}

.login-note {
  font-size: 0.875rem;
  color: #999;
  margin-top: 1rem;
}

/* Workspaces */
.workspaces-container {
  max-width: 800px;
  margin: 0 auto;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.workspaces-list {
  display: grid;
  gap: 1rem;
}

.workspace-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.workspace-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.workspace-card .workspace-link {
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.btn-delete {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-delete:hover {
  background: #fecaca;
}

.btn-delete-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-card h3 {
  margin-bottom: 0.5rem;
}

.workspace-card .hostname {
  color: #666;
  font-family: monospace;
  font-size: 0.875rem;
}

/* Status */
.status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-online {
  background: #dcfce7;
  color: #166534;
}

.status-offline {
  background: #f3f4f6;
  color: #6b7280;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
}

.modal-content h2 {
  margin-bottom: 1rem;
}

.modal-content label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.modal-content input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Workspace Detail */
.workspace-container {
  max-width: 600px;
  margin: 0 auto;
}

.back-link {
  color: #4f46e5;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1rem;
}

.back-link:hover {
  text-decoration: underline;
}

.workspace-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.workspace-info {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.workspace-info p {
  margin-bottom: 0.5rem;
}

.workspace-info code {
  background: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.workspace-actions {
  text-align: center;
}

/* Desktop Login */
.desktop-login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #4f46e5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.success {
  color: #166534;
}

.error {
  color: #dc2626;
}

/* Utility */
.loading, .empty {
  text-align: center;
  color: #666;
  padding: 2rem;
}

/* Responsive */
@media (max-width: 640px) {
  main {
    padding: 1rem;
  }

  .header-row {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .header-row h1 {
    text-align: center;
  }
}
