/* CSS Variables */
:root {
  /* Brand Colors */
  --color-primary: #073b4c;
  --color-accent: #00a0fd;
  --color-secondary: #3bd160;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);

  /* Shadows */
  --shadow-button-hover: 0 5px 15px rgba(0, 160, 253, 0.4);

  /* Semantic Colors (preserved) */
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-error: #dc3545;
  --color-info: #17a2b8;
}

/* 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: var(--gradient-primary);
  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-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.header-logo {
  height: 40px;
  width: auto;
  max-width: 100%;
}

.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,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1em;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 40px;
  cursor: pointer;
}

/* 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: var(--gradient-primary);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-button-hover);
}

.btn-secondary {
  background: white;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: white;
}

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

/* Info box */
.info-box {
  background: #f8f9fa;
  border-left: 4px solid var(--color-primary);
  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 controls */
.sdk-controls {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.help-text {
  display: block;
  font-size: 0.85em;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

/* 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;
  }

  .header-logo {
    height: 32px;
  }

  .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);
  }
}

.chooser-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  gap: 1rem;
}

.chooser-divider::before,
.chooser-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.chooser-divider span {
  color: #999;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
