/* Minimal styles for molecular app */

@keyframes pulse {
  0% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(1.1);
    opacity: 0.7;
  }
  100% { 
    transform: scale(1);
    opacity: 1;
  }
}
html {
  margin: 0;
  padding: 0;
  background: #000;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Text', sans-serif;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  user-select: text;
  font-feature-settings: 'liga' 1, 'kern' 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  background: #000;
}

/* ===== Minimal utility classes extracted from App.jsx ===== */
.app {
  background: #000;
  color: #fff;
  min-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  overflow-x: clip;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Text', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  user-select: text;
  font-feature-settings: 'liga' 1, 'kern' 1;
}

.main {
  position: relative;
  padding: 16px;
  padding-top: 54px;
  user-select: text;
  max-width: 100%;
}

@media (max-width: 768px) {
  .main {
    padding: 12px;
    padding-top: 48px;
  }
  
  .input-section {
    margin-bottom: 20px;
  }
  
  .settings-btn {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

.columns {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
  user-select: text;
  width: 100%;
}

@media (min-width: 1200px) {
  .columns {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 20px;
  }
}

.columns > * {
  flex: 0 0 auto;
}

.column {
  min-width: 400px;
  background: transparent;
  padding: 20px;
  position: relative;
  z-index: 1;
  user-select: text;
}

.input-base,
.app .input-base,
input.input-base {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  caret-color: #ffffff;
  font-size: 14px;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.input-base::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.input-error {
  border: 1px solid rgba(255, 100, 100, 0.5) !important;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  padding: 0;
  cursor: pointer;
  font-size: 20px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.btn-ghost.active {
  background: rgba(255, 255, 255, 0.1);
}

/* Force black around scrollable areas */
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar { background: #000; height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

* {
  box-sizing: border-box;
  user-select: text;
}

/* Prevent body-level horizontal scrolling issues */
html, body { overflow-y: auto; }

/* No extraneous lines or borders per UI rules */
button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 12px 20px;
  user-select: none;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover {
  background: rgba(255, 255, 255, 0.2);
}

input {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  outline: none;
  font-size: 16px;
  min-height: 44px;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* ==================== TEXT SELECTION FIX ==================== */

/* Ensure text elements allow proper selection */
p, div, span, pre, code {
  user-select: text !important;
}

/* Prevent selection on interactive elements */
button, input, canvas, video, svg {
  user-select: none !important;
}

/* ==================== MOLECULAR VIEWER ESSENTIAL STYLES ==================== */

/* 3Dmol.js integration */
.threeDmol-ui,
.threeDmol-ui *,
[class*="threeDmol"],
[class*="3Dmol"],
[class*="3dmol"] {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  user-select: none !important;
}


/* Main 3Dmol viewer container (legacy support) */
#gldiv {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 20px;
  background: #000;
  min-height: 100px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Object column container (legacy support) */
.object-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  flex-shrink: 0;
}

@media (min-width: 1200px) {
  .object-column {
    min-width: 400px;
    width: auto;
  }
}

.object-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.column-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  outline: none;
}

.column-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* (Removed unused viewer and layout classes per icons-only minimal UI) */

/* Ensure proper canvas alignment and visibility */
canvas[class*="3dmol"],
canvas[class*="threeDmol"] {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  position: relative !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ==================== EXTRACTED FROM App.jsx ==================== */

/* Text input wrappers */
.input-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
  padding-right: 120px;
}

@media (max-width: 768px) {
  .input-wrapper {
    padding-right: 0;
  }
  
  .kbd-hint {
    display: none;
  }
}

.input-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kbd-hint {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Text', sans-serif;
  pointer-events: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  right: 0;
  height: 44px;
}

.error-text {
  color: #ff6b6b;
  font-size: 12px;
  margin-top: 8px;
  padding: 0 4px;
}

/* Mode selector */
.mode-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 13px;
  transition: all 0.2s;
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.1);
}

.mode-btn-shortcut {
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.7;
}

/* Camera section */
.camera-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
  background: #000;
  aspect-ratio: 4 / 3;
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-permission {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  text-align: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  font-size: 14px;
}

.click-outline {
  position: absolute;
  border: 2px solid #ffffff;
  background: transparent;
  pointer-events: none;
  z-index: 100;
  box-shadow: none;
  border-radius: 0;
  animation: none;
}

.camera-switch {
  position: absolute;
  top: 12px;
  right: 12px;
}

.camera-switch .btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  width: 44px;
  height: 44px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.hidden {
  display: none !important;
}

.btn-upload {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dropzone {
  width: 100%;
  height: 200px;
  border: none;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  gap: 12px;
}

.dropzone.dragover {
  background: rgba(255, 255, 255, 0.08);
}

.dropzone svg {
  opacity: 0.6;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 180px;
  margin-top: 12px;
  border-radius: 4px;
}

.url-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.url-input {
  flex: 1;
}

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

.molecule-card {
  margin-bottom: 12px;
}

.molecule-title {
  background: transparent;
  padding: 8px;
  margin-bottom: 5px;
  border-radius: 4px;
  font-size: 14px;
}

.molecule-title a {
  color: #ffffff;
  text-decoration: none;
}

.viewer {
  height: 200px;
  width: 100%;
  background: transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  user-select: text;
  min-height: 24px;
  position: relative;
  z-index: 10;
  visibility: visible;
  opacity: 1;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 0;
  border-radius: 4px;
}

.column-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: text;
  flex: 1;
}

.column-icon {
  opacity: 0.8;
  font-size: 16px;
  user-select: none;
  min-width: 16px;
}

.column-title {
  font-size: 14px;
  opacity: 0.7;
  color: #ffffff;
  font-weight: 400;
}

.alert-warning {
  margin-bottom: 16px;
  padding: 10px 12px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 4px;
  font-size: 13px;
  color: rgba(255, 193, 7, 0.9);
}

/* Settings */
.settings-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  z-index: 100;
  outline: none;
}

.settings-modal {
  position: absolute;
  top: 50px;
  right: 10px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 20px;
  min-width: 280px;
  max-width: calc(100vw - 40px);
  z-index: 99;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .settings-modal {
    position: fixed;
    top: 60px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

.settings-title {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #ffffff;
}

.settings-field { margin-bottom: 15px; }

.label {
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 8px;
  display: block;
}

.select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #ffffff;
  font-size: 14px;
}

.select option {
  background: #222;
  color: #fff;
}

.checkbox-input {
  margin-right: 8px;
}

.settings-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #ffffff;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
}

/* ==================== QUICK SETUP COMPONENT STYLES ==================== */

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
  background: #000;
  min-height: 100vh;
}

.container header {
  text-align: center;
  margin-bottom: 40px;
}

.container h1 {
  font-size: 28px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 20px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  transition: all 0.2s;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.setup-container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Existing User Section */
.existing-user {
  text-align: center;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.user-info {
  flex: 1;
  text-align: left;
}

.user-info h3 {
  margin: 0 0 8px 0;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
}

.user-info p {
  margin: 0 0 4px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.usage {
  font-size: 13px !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

/* New User Setup */
.setup-info {
  text-align: center;
  margin-bottom: 30px;
}

.price-display {
  margin-bottom: 16px;
}

.price {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  margin-right: 8px;
}

.per {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

/* Express Payment */
.express-payment {
  margin-bottom: 30px;
}

.express-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  margin-bottom: 16px;
}

.payment-request-btn,
.paypal-container {
  margin-bottom: 16px;
  min-height: 40px;
}

.or-divider {
  position: relative;
  text-align: center;
  margin: 20px 0;
}

.or-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.or-divider span {
  background: #000;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* Form Styles */
.setup-form {
  margin-bottom: 30px;
}

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

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

.autofill-detector {
  position: relative;
  height: 0;
  overflow: hidden;
}

.card-element {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 16px;
  color: #ffffff;
}

.error-message {
  color: #ff6b6b;
  font-size: 13px;
  margin-top: 8px;
}

.autofill-note {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  margin-top: 8px;
}

.optional input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 14px;
  width: 100%;
}

.optional input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Buttons */
.btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
}

.btn-primary:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.btn-link:hover {
  color: #ffffff;
}

.setup-btn {
  width: 100%;
}

.btn-text-hidden {
  display: none;
}

.btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-loading-hidden {
  display: none;
}

.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Features Section */
.features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* Success State */
.setup-success {
  text-align: center;
  padding: 40px 20px;
}

.success-animation {
  margin-bottom: 20px;
}

.success-animation svg {
  color: #00ff88;
}

.setup-success h3 {
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 12px 0;
}

.setup-success p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 30px 0;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 20px 16px;
  }
  
  .setup-container {
    padding: 20px;
  }
  
  .user-card {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .user-info {
    text-align: center;
  }
}
