/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

code {
  font-family: 'Courier New', monospace;
  background: #f4f4f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

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

/* Header */
.header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  font-weight: 600;
}

.subtitle {
  font-size: 1.1em;
  opacity: 0.9;
  font-weight: 300;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 8px;
}

.user-email {
  font-size: 1em;
  font-weight: 500;
}

/* Card */
.card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1.5em;
  margin-bottom: 20px;
  color: #333;
}

/* Form styles */
.form-group {
  margin-bottom: 20px;
}

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

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1em;
  transition: border-color 0.3s;
}

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

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

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

.btn-small {
  padding: 8px 16px;
  font-size: 0.9em;
  margin-top: 10px;
}

/* Info box */
.info-box {
  background: #f8f9fa;
  border-left: 4px solid #667eea;
  padding: 15px;
  border-radius: 4px;
  margin-top: 20px;
  font-size: 0.9em;
  color: #555;
}

.info-box strong {
  color: #333;
}

.info-box ul {
  margin-top: 10px;
  margin-left: 20px;
}

.info-box li {
  margin-bottom: 5px;
}

.info-text {
  color: #666;
  margin-bottom: 20px;
}

/* Error message */
.error-message {
  background: #fee;
  color: #c33;
  padding: 12px 15px;
  border-radius: 6px;
  margin-top: 15px;
  border-left: 4px solid #c33;
}

/* Status section */
.status-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.status-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.status-item {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
}

.status-label {
  display: block;
  font-size: 0.85em;
  color: #666;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-value {
  display: block;
  font-size: 1.1em;
  font-weight: 600;
  color: #333;
}

/* Status value colors */
.status-value.status-authenticated {
  color: #28a745;
}

.status-value.status-authenticating {
  color: #ffc107;
}

.status-value.status-auth-failed,
.status-value.status-auth-failed-redirecting {
  color: #dc3545;
}

.status-value.status-initializing,
.status-value.status-loading-config,
.status-value.status-mounted {
  color: #17a2b8;
}

/* SDK container */
.sdk-container {
  margin-top: 20px;
}

#sdk-mount {
  min-height: 400px;
  border: 2px dashed #e0e0e0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}

#sdk-mount:empty::after {
  content: 'SDK will mount here';
  color: #999;
  font-style: italic;
}

/* Event log */
.logs-section {
  background: #1e1e1e;
  color: #d4d4d4;
}

.logs-section h2 {
  color: #fff;
}

.event-log {
  background: #252526;
  border: 1px solid #3e3e42;
  border-radius: 6px;
  padding: 15px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.6;
}

.log-entry {
  margin-bottom: 8px;
  padding: 5px;
  border-radius: 3px;
}

.log-time {
  color: #858585;
  margin-right: 8px;
}

.log-info {
  color: #4ec9b0;
}

.log-success {
  color: #6a9955;
}

.log-error {
  color: #f48771;
  background: rgba(244, 135, 113, 0.1);
}

.event-log:empty::after {
  content: 'Events will appear here...';
  color: #666;
  font-style: italic;
}

/* Scrollbar styling for event log */
.event-log::-webkit-scrollbar {
  width: 8px;
}

.event-log::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.event-log::-webkit-scrollbar-thumb {
  background: #424242;
  border-radius: 4px;
}

.event-log::-webkit-scrollbar-thumb:hover {
  background: #4e4e4e;
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .header h1 {
    font-size: 2em;
  }

  .card {
    padding: 20px;
  }

  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .user-info {
    width: 100%;
    justify-content: center;
  }

  .status-info {
    grid-template-columns: 1fr;
  }
}

/* Page visibility */
.page {
  animation: fadeIn 0.3s ease-in;
}

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