/* ==========================================================================
   MODALS: UPLOAD DESIGN & LIVE WEBSITE PREVIEW SIMULATOR
   ========================================================================== */

/* Overlay backdrop */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(4, 5, 8, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   UPLOAD MODAL
   ========================================================================== */

.modal-dialog {
  background: #11131c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 117, 151, 0.15);
  transform: scale(0.94) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: rotate(90deg);
}

.modal-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 400;
}

.form-input, .form-select, .form-textarea {
  background: #090b10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--sakura-pink);
  box-shadow: 0 0 12px var(--sakura-glow);
}

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

/* File Upload Zone */
.upload-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--sakura-pink);
  background: rgba(255, 117, 151, 0.05);
}

.dropzone-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--sakura-pink);
}

.dropzone-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dropzone-preview {
  max-height: 140px;
  border-radius: 8px;
  margin-top: 10px;
  display: none;
  border: 1px solid var(--border-glass);
  object-fit: cover;
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================================================
   LIVE WEBSITE PREVIEW SIMULATOR (FULL-SCREEN EXPERIENCE)
   ========================================================================== */

.simulator-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 6, 9, 0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.simulator-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Simulator Top Bar */
.sim-topbar {
  height: 64px;
  background: #0d0f16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 20px;
  z-index: 10;
}

.sim-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 220px;
}

.sim-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.sim-tag {
  background: rgba(255, 117, 151, 0.15);
  color: var(--sakura-light);
  border: 1px solid rgba(255, 117, 151, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

/* Device Switcher (Desktop, Laptop, Tablet, Mobile) */
.sim-device-switcher {
  display: flex;
  align-items: center;
  background: #07080c;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}

.device-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.device-btn:hover {
  color: #fff;
}

.device-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Address Bar in Simulator */
.sim-address-bar {
  flex: 1;
  max-width: 480px;
  background: #07080c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.sim-lock-icon {
  color: #10b981;
  font-size: 0.85rem;
}

.sim-url-text {
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Simulator Actions */
.sim-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s;
  text-decoration: none;
}

.sim-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sim-btn-close {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.sim-btn-close:hover {
  background: #ef4444;
  color: #fff;
}

/* Simulator Viewport Area */
.sim-viewport-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

/* Device Shells */
.device-shell {
  height: 100%;
  max-height: 100%;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), height 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-radius 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.device-shell.mode-desktop {
  width: 100%;
  border-radius: 8px;
}

.device-shell.mode-laptop {
  width: 1200px;
  max-width: 95vw;
  border-radius: 12px;
  border: 4px solid #1e212b;
}

.device-shell.mode-tablet {
  width: 768px;
  max-width: 90vw;
  border-radius: 20px;
  border: 8px solid #1a1c26;
}

.device-shell.mode-mobile {
  width: 390px;
  max-width: 90vw;
  border-radius: 36px;
  border: 10px solid #151722;
}

/* Simulator Iframe */
.sim-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

/* Simulator Loading Indicator */
.sim-loader {
  position: absolute;
  inset: 0;
  background: #0b0d14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 5;
  transition: opacity 0.3s ease;
}

.sim-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 117, 151, 0.2);
  border-top-color: var(--sakura-pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fallback Notice Banner for CORS blocked external domains */
.sim-fallback-banner {
  display: none;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 20, 30, 0.95);
  border: 1px solid rgba(255, 183, 197, 0.4);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  border-radius: 10px;
  padding: 12px 20px;
  color: #fff;
  font-size: 0.85rem;
  z-index: 20;
  align-items: center;
  gap: 12px;
}

.sim-fallback-banner.show {
  display: flex;
}
