/**
 * Hydrogen Calendar Embeds - Inline Block Editor Styles
 *
 * Blue container, white settings panels.
 *
 * @package hydrogen-calendar-embeds
 */

/* ========================================
   Main Container
   ======================================== */

.hycal-inline-editor {
  background: #2563eb;
  border-radius: 8px;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
}

/* ========================================
   Header
   ======================================== */

.hycal-inline-editor__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: #fff;
}

.hycal-inline-editor__header-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: #fff;
  stroke: #fff;
}

.hycal-inline-editor__header .components-icon {
  fill: #fff;
}

.hycal-inline-editor__title {
  font-size: 18px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
}

/* ========================================
   Sections - All White Background
   ======================================== */

.hycal-inline-editor__section {
  background: #fff;
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hycal-inline-editor__section--primary {
  background: #fff;
}

.hycal-inline-editor__section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
}

.hycal-inline-editor__section-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: currentColor;
}

.hycal-inline-editor__section-title {
  flex: 1;
  color: #1e293b;
}

/* ========================================
   Collapsible Section Toggle
   ======================================== */

.hycal-inline-editor__section-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: none;
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
}

.hycal-inline-editor__section-toggle:hover {
  background: #f8fafc;
}

.hycal-inline-editor__section-summary {
  margin-left: auto;
  font-weight: 400;
  color: #6b7280;
  font-size: 13px;
}

.hycal-inline-editor__chevron {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: #9ca3af;
}

.hycal-inline-editor__chevron--open {
  transform: rotate(90deg);
}

/* ========================================
   Section Content
   ======================================== */

.hycal-inline-editor__section-content {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
}

/* Override WordPress component styles */
.hycal-inline-editor__section-content .components-base-control {
  margin-bottom: 12px;
}

.hycal-inline-editor__section-content .components-base-control__label {
  color: #374151;
  font-weight: 500;
  margin-bottom: 6px;
}

.hycal-inline-editor__section-content .components-base-control__help {
  color: #6b7280;
  font-size: 12px;
}

.hycal-inline-editor__section-content .components-toggle-control[disabled],
.hycal-inline-editor__section-content .components-toggle-control.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.hycal-inline-editor__section-content
  .components-base-control:has(.components-toggle-control[disabled])
  .components-toggle-control__label {
  color: #9ca3af;
}

.hycal-inline-editor__section-content .components-text-control__input,
.hycal-inline-editor__section-content .components-select-control__input {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #1e293b;
}

.hycal-inline-editor__section-content .components-text-control__input:focus,
.hycal-inline-editor__section-content .components-select-control__input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}

.hycal-inline-editor__section-content
  .components-toggle-control
  .components-base-control__field {
  margin-bottom: 0;
}

.hycal-inline-editor__section-content .components-toggle-control__label {
  color: #374151;
}

.hycal-inline-editor__section-content .components-checkbox-control__label {
  color: #374151;
}

/* ========================================
   Primary Section (Calendar Source)
   ======================================== */

.hycal-inline-editor__section--primary .components-base-control__label {
  color: #374151;
}

.hycal-inline-editor__section--primary .components-base-control__help {
  color: #6b7280;
}

.hycal-inline-editor__section--primary .components-toggle-control__label {
  color: #374151;
}

.hycal-inline-editor__calendars {
  padding: 16px;
}

.hycal-inline-editor__calendar-count {
  font-weight: 600;
  color: #059669;
  margin-bottom: 8px;
}

.hycal-inline-editor__calendar-urls {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 12px;
}

.hycal-inline-editor__calendar-url {
  font-family: monospace;
  font-size: 11px;
  color: #4b5563;
  padding: 4px 0;
  border-bottom: 1px solid #e5e7eb;
  word-break: break-all;
}

.hycal-inline-editor__calendar-url:last-child {
  border-bottom: none;
}

.hycal-inline-editor__no-source {
  color: #6b7280;
  font-style: italic;
  margin-bottom: 12px;
}

.hycal-inline-editor__add-btn {
  margin-bottom: 0 !important;
}

.hycal-inline-editor__quick-toggles {
  padding: 12px 16px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 24px;
}

.hycal-inline-editor__quick-toggles .components-toggle-control {
  margin: 0;
}

.hycal-inline-editor__quick-toggles .components-base-control__field {
  margin-bottom: 0;
}

/* ========================================
   Views Grid
   ======================================== */

.hycal-inline-editor__views-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 16px;
  margin-bottom: 16px;
}

.hycal-inline-editor__views-grid .components-checkbox-control {
  margin: 0;
}

.hycal-inline-editor__custom-list {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ========================================
   FC Args (Advanced)
   ======================================== */

.hycal-inline-editor__fc-args {
  margin-top: 12px;
}

.hycal-inline-editor__fc-args .components-base-control__label {
  color: #374151;
}

.hycal-inline-editor__fc-args-preview {
  background: #1e293b;
  border-radius: 4px;
  padding: 12px;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
  margin: 8px 0 12px;
}

/* ========================================
   Footer
   ======================================== */

.hycal-inline-editor__footer {
  text-align: center;
  padding-top: 12px;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   Modals
   ======================================== */

.hycal-modal {
  min-width: 500px;
  max-width: 600px;
}

.hycal-modal--large {
  max-width: 700px;
}

.hycal-modal__content p {
  margin: 0 0 12px 0;
  color: #666;
  font-size: 13px;
}

.hycal-modal__textarea {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
}

.hycal-modal__textarea--code {
  min-height: 300px;
  tab-size: 2;
  line-height: 1.5;
}

.hycal-modal__textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
  outline: none;
}

.hycal-modal__textarea::placeholder {
  color: #999;
}

.hycal-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}
/* ========================================
   Calendar Identifiers (cal_ids) Mapping
   ======================================== */

.hycal-inline-editor__cal-ids-mapping {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.hycal-inline-editor__cal-ids-mapping .components-base-control__label {
  font-weight: 500;
  color: #333;
  margin: 0 0 12px;
}

.hycal-inline-editor__cal-ids-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: #f5f5f5;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.hycal-inline-editor__cal-id-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 13px;
}

.hycal-inline-editor__cal-id-prefix {
  font-weight: 600;
  color: #2563eb;
  padding: 4px 8px;
  background-color: #eff6ff;
  border-radius: 3px;
  min-width: 60px;
  font-family: monospace;
}

.hycal-inline-editor__cal-id-url {
  color: #666;
  word-break: break-all;
  flex: 1;
  font-family: monospace;
  font-size: 12px;
}

/* ========================================
   Locale Code Styling
   ======================================== */

.hycal-inline-editor__section-content .components-select-control__input {
  font-size: 13px;
}

/* Style for locale options in the dropdown */
.hycal-inline-editor__section-content .components-select-control__input option {
  padding: 8px 12px;
}

/* Make the second part of the locale label (the code) appear in lighter text */
.components-select-control {
  font-size: 13px;
}
