/* TVD Design Modal & Popover CSS */
.tvd-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 20px;
}

.tvd-modal-card {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  position: relative;
  animation: tvd-modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tvd-modal-sm {
  max-width: 440px;
}

.tvd-modal-export {
  max-width: 480px;
}

@keyframes tvd-modal-pop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.tvd-modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 22px;
  color: var(--tvd-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--tvd-transition);
  z-index: 10;
}

.tvd-modal-close:hover {
  background: #e2e8f0;
  color: var(--tvd-text-primary);
}

.tvd-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--tvd-border);
}

.tvd-modal-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--tvd-text-primary);
  margin: 0;
}

.tvd-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Modal Tabs Navigation */
.tvd-modal-tabs {
  width: 220px;
  background: #f8fafc;
  border-right: 1px solid var(--tvd-border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tvd-modal-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--tvd-radius-md);
  border: none;
  background: transparent;
  color: var(--tvd-text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--tvd-transition);
  text-align: left;
}

.tvd-modal-tab-btn:hover {
  background: #f1f5f9;
  color: var(--tvd-text-primary);
}

.tvd-modal-tab-btn.active {
  background: var(--tvd-primary-light);
  color: var(--tvd-primary);
  font-weight: 600;
}

/* Modal Content Panel */
.tvd-modal-content-panel {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  max-height: 75vh;
}

.tvd-tab-pane {
  display: none;
}

.tvd-tab-pane.active {
  display: block;
}

.tvd-modal-search {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: var(--tvd-radius-full);
  padding: 8px 18px;
  margin-bottom: 24px;
}

.tvd-modal-search input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  margin-left: 8px;
  font-size: 14px;
}

.tvd-preset-section {
  margin-bottom: 24px;
}

.tvd-preset-group-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--tvd-text-primary);
  margin-bottom: 14px;
}

.tvd-preset-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.tvd-preset-card {
  border: 1px solid var(--tvd-border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: var(--tvd-transition);
  text-align: center;
  background: #ffffff;
}

.tvd-preset-card:hover {
  border-color: var(--tvd-primary);
  box-shadow: 0 6px 16px rgba(125, 42, 232, 0.12);
  transform: translateY(-2px);
}

.tvd-card-preview-thumb {
  height: 72px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.tvd-card-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--tvd-text-secondary);
}

.tvd-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tvd-text-primary);
}

/* Custom Size Form */
.tvd-form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.tvd-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tvd-input-group label, .tvd-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--tvd-text-secondary);
}

.tvd-input-group input, .tvd-input-group select, .tvd-form-group select {
  padding: 10px 14px;
  border: 1px solid var(--tvd-border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: var(--tvd-transition);
}

.tvd-input-group input:focus, .tvd-form-group select:focus {
  border-color: var(--tvd-primary);
  box-shadow: 0 0 0 3px var(--tvd-primary-light);
}

.tvd-btn-primary {
  background: var(--tvd-primary);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--tvd-transition);
}

.tvd-btn-primary:hover {
  background: var(--tvd-primary-hover);
}

.tvd-btn-block {
  width: 100%;
}

.tvd-btn-large {
  padding: 14px 24px;
  font-size: 15px;
}

.tvd-btn-secondary {
  background: #f1f5f9;
  color: var(--tvd-text-primary);
  border: 1px solid var(--tvd-border);
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--tvd-transition);
}

.tvd-btn-secondary:hover {
  background: #e2e8f0;
}

/* Upload Dropzone */
.tvd-upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  background: #f8fafc;
  transition: var(--tvd-transition);
}

.tvd-upload-dropzone.dragover {
  border-color: var(--tvd-primary);
  background: var(--tvd-primary-light);
}

.tvd-upload-cloud-icon {
  margin-bottom: 16px;
}

.tvd-upload-dropzone h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--tvd-text-primary);
  margin-bottom: 20px;
}

.tvd-upload-btns {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.tvd-upload-note {
  font-size: 12px;
  color: var(--tvd-text-muted);
  margin: 0;
}
