/* YouTube Embed Code Generator — Dedicated Styles */

/* Search bar */
#embed-url-input {
  flex: 1;
  padding: 1rem 1.5rem;
  padding-right: 230px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: #ffffff;
  color: #0f172a;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
#embed-url-input::placeholder { color: #64748b; }
#embed-url-input:focus { border-color: #ffffff; box-shadow: 0 0 25px rgba(255, 255, 255, 0.4); }

#embed-generate-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  padding: 0 1.5rem;
  border: none;
  border-radius: 8px;
  background: #1877F2;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
}
#embed-generate-btn:hover { background: #1565C0; box-shadow: 0 6px 18px rgba(24, 119, 242, 0.6); }

/* Video ID Bar */
.em-video-id-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.em-id-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.em-video-id-bar code {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.em-copy-small {
  background: none;
  border: 1px solid var(--input-border);
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.em-copy-small:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Two-column layout */
.em-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

/* Left column */
.em-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Preview */
.em-preview-section h3,
.em-code-section h3,
.em-options-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

/* Disable hover lift animation on interactive tool panels */
.em-options-panel:hover,
.em-preview-section:hover,
.em-code-section:hover,
.em-video-id-bar:hover {
  transform: none !important;
  box-shadow: var(--card-shadow) !important;
}

.em-preview-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.em-preview-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Code output */
.em-code-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--input-border);
  margin-bottom: 1rem;
}

.em-tab {
  background: none;
  border: none;
  padding: 0.6rem 1.2rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.em-tab:hover {
  color: var(--text-primary);
}

.em-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.em-code-output {
  position: relative;
}

.em-code-output pre {
  background: var(--bg-deep);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 1.25rem;
  overflow-x: auto;
  max-height: 300px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.em-code-output pre code {
  color: var(--text-primary);
  font-family: 'Fira Code', 'Consolas', monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

.em-copy-code {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--input-border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  z-index: 2;
}

.em-copy-code:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Right column — Options Panel */
.em-right {
  position: sticky;
  top: 1rem;
}

.em-options-panel {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.em-options-panel::-webkit-scrollbar { width: 6px; }
.em-options-panel::-webkit-scrollbar-track { background: transparent; }
.em-options-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.em-option-group {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--input-border);
}

.em-option-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.em-option-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

/* Dimension inputs */
.em-dimension-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.em-dim-field {
  flex: 1;
}

.em-dim-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.em-dim-field input,
.em-dim-field select,
.em-options-panel select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.em-dim-field input:focus,
.em-options-panel select:focus {
  border-color: var(--accent-cyan);
}

.em-dim-x {
  font-size: 1.2rem;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
}

/* Toggle switches */
.em-toggle-row {
  margin-bottom: 0.5rem;
}

.em-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
  user-select: none;
}

.em-toggle input[type="checkbox"] {
  display: none;
}

.em-toggle-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  transition: background 0.3s;
  flex-shrink: 0;
}

[data-theme="light"] .em-toggle-slider {
  background: rgba(0,0,0,0.15);
}

.em-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
}

.em-toggle input:checked + .em-toggle-slider {
  background: var(--accent-red);
}

.em-toggle input:checked + .em-toggle-slider::before {
  transform: translateX(16px);
}

/* Select dropdown */
.em-options-panel select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* Responsive */
@media (max-width: 900px) {
  .em-layout {
    grid-template-columns: 1fr;
  }
  
  .em-right {
    position: static;
  }
}

@media (max-width: 768px) {
  .em-code-tabs {
    flex-wrap: wrap;
  }
}
