/* ==========================================
   ISR WEB DESIGN — CUSTOMIZATION STUDIO CSS
   ========================================== */

/* Studio Modal Overlay */
.isr-studio-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  font-family: 'Inter', sans-serif;
  color: #0f172a;
}

.isr-studio-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Studio Header */
.isr-studio-header {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.isr-studio-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.isr-studio-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.isr-studio-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.isr-studio-badge {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
  padding: 4px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Step Navigation Progress */
.isr-studio-steps {
  display: flex;
  align-items: center;
  gap: 8px;
}

.isr-step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  padding: 6px 12px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.isr-step-item.active {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

.isr-step-item.completed {
  color: #16a34a;
}

.isr-step-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.isr-step-item.active .isr-step-number {
  background: #4f46e5;
  color: #ffffff;
}

.isr-step-item.completed .isr-step-number {
  background: #16a34a;
  color: #ffffff;
}

/* Viewport Switcher */
.isr-viewport-controls {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.isr-view-btn {
  border: none;
  background: transparent;
  color: #64748b;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.isr-view-btn:hover {
  color: #0f172a;
}

.isr-view-btn.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Header Actions */
.isr-studio-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.isr-btn-sm {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.isr-btn-sm:hover {
  border-color: #4f46e5;
  color: #4f46e5;
}

.isr-btn-close {
  background: #f1f5f9;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.isr-btn-close:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Main Studio Layout: Split Screen */
.isr-studio-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Sidebar Controls Panel */
.isr-studio-sidebar {
  width: 420px;
  background: #ffffff;
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

/* Sidebar Navigation Tabs */
.isr-sidebar-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  scroll-behavior: smooth;
}

.isr-sidebar-tabs::-webkit-scrollbar {
  height: 3px;
}

.isr-sidebar-tabs::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.isr-tab-btn {
  flex: 1;
  min-width: max-content;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.isr-tab-btn:hover {
  color: #1e293b;
}

.isr-tab-btn.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
  background: #ffffff;
}

/* Sidebar Content Area */
.isr-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.isr-tab-panel {
  display: none;
}

.isr-tab-panel.active {
  display: block;
}

/* Form Controls & Accordions */
.isr-control-group {
  margin-bottom: 20px;
}

.isr-control-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.isr-control-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.4;
}

.isr-input-text,
.isr-select,
.isr-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.isr-input-text:focus,
.isr-select:focus,
.isr-textarea:focus {
  outline: none;
  border-color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.isr-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Color Palettes Grid */
.isr-palettes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.isr-palette-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: #ffffff;
}

.isr-palette-card:hover {
  border-color: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.isr-palette-card.active {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px #4f46e5;
}

.isr-palette-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.isr-palette-colors {
  display: flex;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
}

.isr-swatch {
  flex: 1;
  height: 100%;
}

/* Custom Color Pickers */
.isr-color-pickers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.isr-color-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.isr-color-picker-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.isr-color-picker-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: none;
}

.isr-color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.isr-color-picker-input::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

/* Page & Section Item List */
.isr-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.isr-list-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.isr-list-item.active {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.04);
}

.isr-list-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.isr-list-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.isr-icon-btn {
  background: transparent;
  border: none;
  color: #64748b;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.isr-icon-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.isr-icon-btn.danger:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Preview Canvas Container */
.isr-preview-container {
  flex: 1;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  position: relative;
}

/* Responsive Frames */
.isr-preview-frame-wrap {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: width 0.3s ease, height 0.3s ease;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.isr-preview-frame-wrap.desktop {
  width: 100%;
  max-width: 1280px;
  height: 100%;
}

.isr-preview-frame-wrap.tablet {
  width: 768px;
  height: 90%;
  border: 12px solid #1e293b;
  border-radius: 24px;
}

.isr-preview-frame-wrap.mobile {
  width: 375px;
  height: 90%;
  border: 14px solid #1e293b;
  border-radius: 36px;
}

.isr-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

/* Bottom Footer Bar */
.isr-studio-footer {
  height: 64px;
  background: #ffffff;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 10;
}

.isr-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.isr-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.isr-btn-primary {
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
  transition: all 0.2s;
}

.isr-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.isr-btn-secondary {
  background: #ffffff;
  color: #334155;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.isr-btn-secondary:hover {
  border-color: #4f46e5;
  color: #4f46e5;
}

/* Student Project Special Form Highlight */
.isr-student-badge-banner {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(37, 99, 235, 0.08));
  border: 1px dashed rgba(79, 70, 229, 0.3);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.isr-student-badge-icon {
  font-size: 1.8rem;
}

.isr-student-price-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #4f46e5;
}

/* Toast Notifications */
.isr-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.isr-toast {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: isrSlideUp 0.3s ease;
}

.isr-toast.success {
  border-left: 4px solid #22c55e;
}

.isr-toast.error {
  border-left: 4px solid #ef4444;
}

@keyframes isrSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   ADVANCED BUILDER & STUDIO UPGRADES
   ========================================== */

/* Fullscreen Preview Mode */
.isr-studio-overlay.fullscreen-preview .isr-studio-sidebar,
.isr-studio-overlay.fullscreen-preview .isr-studio-header,
.isr-studio-overlay.fullscreen-preview .isr-studio-footer {
  display: none !important;
}

.isr-studio-overlay.fullscreen-preview .isr-studio-body {
  height: 100vh !important;
}

.isr-studio-overlay.fullscreen-preview .isr-preview-container {
  padding: 0 !important;
  background: #0f172a;
}

.isr-studio-overlay.fullscreen-preview .isr-preview-frame-wrap {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}

.isr-exit-fullscreen-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10005;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.isr-exit-fullscreen-btn:hover {
  background: #4f46e5;
}

/* Reusable Modal Dialog Overlay (Section Library & Final Review) */
.isr-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  padding: 20px;
}

.isr-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.isr-modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: isrPopIn 0.3s ease;
}

@keyframes isrPopIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.isr-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.isr-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.isr-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.isr-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

/* Categorized Section Library Grid */
.isr-library-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.isr-lib-tab-btn {
  padding: 8px 16px;
  border-radius: 50px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.isr-lib-tab-btn.active {
  background: #4f46e5;
  color: #ffffff;
}

.isr-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.isr-lib-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.isr-lib-card:hover {
  border-color: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.1);
}

.isr-lib-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.isr-lib-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
  margin-bottom: 4px;
}

.isr-lib-card-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 14px;
}

/* Drag and Drop Item Handles */
.isr-drag-handle {
  cursor: grab;
  color: #94a3b8;
  padding: 4px 8px;
  border-radius: 4px;
}

.isr-drag-handle:hover {
  color: #4f46e5;
  background: #f1f5f9;
}

.isr-list-item.dragging {
  opacity: 0.5;
  border: 2px dashed #4f46e5;
}

.isr-list-item.hidden-sec {
  opacity: 0.6;
  background: #f8fafc;
}

.isr-list-item.hidden-sec .isr-list-item-title {
  text-decoration: line-through;
  color: #94a3b8;
}

/* Image & Media Picker Grid */
.isr-stock-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.isr-stock-img-item {
  width: 100%;
  height: 65px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.isr-stock-img-item:hover, .isr-stock-img-item.selected {
  border-color: #4f46e5;
  transform: scale(1.05);
}

/* Icon Picker Grid */
.isr-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.isr-icon-option {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  font-size: 1.1rem;
  color: #334155;
  transition: all 0.2s;
}

.isr-icon-option:hover, .isr-icon-option.selected {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

/* Repeatable List Items */
.isr-repeatable-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.isr-repeatable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.83rem;
  color: #334155;
}

/* Responsive adjustments for editor layout */
@media (max-width: 900px) {
  .isr-studio-sidebar {
    width: 100%;
    height: 50vh;
  }
  .isr-studio-body {
    flex-direction: column-reverse;
  }
  .isr-preview-container {
    height: 50vh;
  }
  .isr-preview-frame-wrap.tablet,
  .isr-preview-frame-wrap.mobile {
    height: 100%;
    border-width: 4px;
  }
}

