#template-manager-modal,
#template-variables-modal {
  display: none;
}

#template-manager-modal.is-open {
  display: flex;
}

.template-manager-modal__content {
  max-width: 1200px;
  max-height: 90vh;
}

.template-manager-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  padding: 0 20px;
  background: var(--bg-secondary);
}

#template-manager-modal .template-tab-content {
  display: none;
  padding: 20px;
}

#template-manager-modal .template-tab-content.active {
  display: block;
}

.template-manager-modal__body {
  overflow-y: auto;
  max-height: calc(90vh - 180px);
}

.template-drop-zone {
  margin-bottom: 20px;
  padding: 40px;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  text-align: center;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.3s;
}

.template-drop-zone__title {
  color: var(--text-primary);
  margin-bottom: 10px;
  font-size: 18px;
}

.template-drop-zone__desc {
  color: var(--text-tertiary);
  margin-bottom: 15px;
  font-size: 14px;
}

.template-drop-zone__input {
  display: none;
}

.template-drop-zone__btn {
  font-size: 15px;
  padding: 12px 24px;
}

.template-upload-progress {
  display: none;
  margin-bottom: 20px;
}

.template-info-form {
  display: none;
}

.template-info-form.active {
  display: block;
}

.template-selected-file {
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 4px;
  color: var(--text-secondary);
}

.template-preview-section {
  display: none;
  margin-top: 20px;
}

.template-preview-section.active {
  display: block;
}

.template-preview-heading {
  margin-bottom: 15px;
}

.template-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.template-preview-card {
  background: var(--bg-secondary);
}

.template-preview-card__body {
  padding: 15px;
}

.template-preview-card__title {
  margin-bottom: 10px;
  color: var(--text-primary);
}

.template-preview-card__text {
  font-size: 13px;
  color: var(--text-secondary);
}

.template-validation-warnings {
  margin-top: 15px;
}

.template-upload-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.template-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.template-list-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-tertiary);
}

.template-guide-title {
  margin-bottom: 20px;
}

.template-guide-step {
  margin-bottom: 25px;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  color: white;
}

.template-guide-subtitle {
  margin-bottom: 15px;
  color: white;
  font-size: 16px;
}

.template-guide-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.template-guide-card {
  text-align: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.template-guide-number {
  font-size: 32px;
  margin-bottom: 10px;
}

.template-guide-card-title {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
}

.template-guide-card-desc {
  font-size: 12px;
  opacity: 0.9;
}

.template-variables-title {
  margin-bottom: 15px;
}

.template-variables-desc {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.8;
}

.template-variables-code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  color: #0ECB81;
}

.template-variables-warning {
  color: #F0B90B;
}

.template-variables-underline {
  text-decoration: underline;
}

.template-variables-modal__content {
  max-width: 600px;
}

.template-variables-modal__heading {
  margin-bottom: 15px;
}

.template-variables-modal__heading--spaced {
  margin-top: 20px;
}

.template-variables-modal__list {
  max-height: 400px;
  overflow-y: auto;
}

.template-variables-modal__loading {
  text-align: center;
  padding: 20px;
}

@media (max-width: 768px) {
  .template-preview-grid,
  .template-guide-steps {
    grid-template-columns: 1fr;
  }

  .template-upload-actions {
    flex-direction: column;
  }
}

/* Template manager tabs */
.template-tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.template-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(14, 203, 129, 0.1);
}

.template-tab-btn.active {
    color: #0ECB81;
    border-bottom-color: #0ECB81;
}

.template-tab-content {
    padding: 20px;
}

.drop-zone.drag-over {
    border-color: #0ECB81;
    background: rgba(14, 203, 129, 0.1);
}

.guide-step {
    margin-bottom: 20px;
}
