/* BIMI Studio Styles */

.bimi-studio-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

.studio-panel {
  background: var(--surface-bg, #111827);
  border: 1px solid var(--border-color, #1f2937);
  border-radius: 12px;
  padding: 1.5rem;
}

.drop-zone {
  border: 2px dashed #374151;
  border-radius: 10px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.06);
}

.drop-zone-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.drop-zone-hint {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0.4rem;
}

.canvas-preview-wrapper {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 1.5rem auto;
  aspect-ratio: 1 / 1;
  background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 20px 20px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #374151;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.canvas-preview-wrapper.is-dragging {
  cursor: grabbing;
}

.drag-hint-bar {
  text-align: center;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

.drag-hint-text {
  font-size: 0.78rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  display: inline-block;
}

.btn-mini-reset {
  background: transparent;
  border: 1px solid #374151;
  color: #9ca3af;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-mini-reset:hover {
  background: #1f2937;
  color: #f3f4f6;
  border-color: #4b5563;
}

.mini-number-input {
  width: 58px;
  background: #090d16;
  border: 1px solid #374151;
  color: #f3f4f6;
  border-radius: 4px;
  padding: 0.2rem 0.35rem;
  font-size: 0.8rem;
  text-align: center;
}

.align-preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.btn-align-preset {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #374151;
  color: #cbd5e1;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-align-preset:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

#canvas-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#canvas-preview svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.circle-guide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 50%;
  border: 2px dashed rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.studio-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-row label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #d1d5db;
  display: flex;
  justify-content: space-between;
}

.control-row input[type="range"] {
  width: 100%;
  accent-color: #3b82f6;
}

.bg-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.bg-option-label {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

#custom-color-input {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

.contrast-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2d3748;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.contrast-badges {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.contrast-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.contrast-note {
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.4;
  margin: 0;
}

/* Simulator Section */
.simulator-section {
  background: var(--surface-bg, #111827);
  border: 1px solid var(--border-color, #1f2937);
  border-radius: 12px;
  padding: 1.5rem;
}

.sim-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #1f2937;
  padding-bottom: 1rem;
}

.sim-nav-tabs, .sim-theme-toggle {
  display: flex;
  gap: 0.5rem;
}

.client-btn, .theme-btn {
  background: #1f2937;
  color: #d1d5db;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.client-btn:hover, .theme-btn:hover {
  background: #374151;
}

.client-btn.active, .theme-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

.sim-customizer-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .sim-customizer-bar {
    grid-template-columns: 1fr;
  }
}

.sim-customizer-bar input {
  background: #0f172a;
  border: 1px solid #374151;
  color: #f3f4f6;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  width: 100%;
}

/* Simulated Email Client Viewports */
.inbox-theme-wrapper {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #374151;
  transition: background-color 0.2s, color 0.2s;
}

/* Theme styles for simulator */
.theme-light-mode {
  background: #ffffff;
  color: #1f2937;
}

.theme-dark-mode {
  background: #1e1e1e;
  color: #e5e7eb;
}

.theme-light-mode .sim-inbox-row {
  border-bottom: 1px solid #f0f2f5;
}

.theme-dark-mode .sim-inbox-row {
  border-bottom: 1px solid #2d2d2d;
}

/* Gmail Mobile Skin */
.gmail-mobile-box {
  padding: 0.85rem;
}

.gmail-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

.gmail-list-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0;
}

.gmail-avatar-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gmail-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gmail-meta {
  flex-grow: 1;
  min-width: 0;
}

.gmail-sender-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.9rem;
}

.gmail-subject {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.gmail-snippet {
  font-size: 0.8rem;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Apple Mail iOS Skin */
.apple-mail-box {
  padding: 1rem;
}

.apple-mail-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 0;
}

.apple-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.apple-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apple-mail-content {
  flex-grow: 1;
}

.apple-sender-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.apple-subject-line {
  font-size: 0.85rem;
  font-weight: 600;
}

.apple-preview-text {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Yahoo Mail Skin */
.yahoo-mail-box {
  padding: 1rem;
}

.yahoo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
}

.yahoo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.yahoo-avatar img {
  width: 100%;
  height: 100%;
}

/* Export & DNS Section */
.export-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .export-section {
    grid-template-columns: 1fr;
  }
}

.dns-code-block {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: #38bdf8;
  word-break: break-all;
  position: relative;
}

.btn-primary-action {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s ease;
  text-decoration: none;
}

.btn-primary-action:hover {
  background: #1d4ed8;
}

.btn-secondary-action {
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.btn-secondary-action:hover {
  background: #374151;
}
