/* ==========================================================================
   PORTFOLIO STUDIO & CMS — editor.css
   Isolated styles for secret editor modal, auth dialog, and live CMS controls
   ========================================================================== */

/* Make secret trigger star clickable with subtle magical effect */
.static-star.s3 {
  pointer-events: all !important;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
  z-index: 8;
}

.static-star.s3:hover {
  transform: scale(1.7) rotate(45deg);
  filter: drop-shadow(0 0 10px rgba(46, 196, 182, 0.9)) drop-shadow(0 0 20px rgba(232, 25, 139, 0.6));
}

/* ==========================================================================
   AUTH DIALOG OVERLAY
   ========================================================================== */
#ped-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 10, 0.82);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#ped-auth-overlay.ped-visible {
  opacity: 1;
  pointer-events: all;
}

.ped-auth-card {
  width: 90%;
  max-width: 440px;
  background: rgba(12, 12, 22, 0.92);
  border: 1.5px solid rgba(232, 25, 139, 0.4);
  border-radius: 14px;
  box-shadow: 0 0 50px rgba(232, 25, 139, 0.2), 0 20px 40px rgba(0, 0, 0, 0.7);
  padding: 26px 28px;
  color: #F0EBF4;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

#ped-auth-overlay.ped-visible .ped-auth-card {
  transform: scale(1) translateY(0);
}

.ped-auth-card.ped-shake {
  animation: ped-shake 0.4s ease-in-out;
}

@keyframes ped-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

.ped-auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ped-auth-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #2EC4B6;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ped-auth-desc {
  font-size: 0.82rem;
  color: rgba(240, 235, 244, 0.65);
  margin-bottom: 20px;
  line-height: 1.5;
}

.ped-auth-input-group {
  position: relative;
  margin-bottom: 16px;
}

.ped-auth-input {
  width: 100%;
  padding: 12px 42px 12px 14px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(46, 196, 182, 0.35);
  border-radius: 8px;
  color: #fff;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  box-sizing: border-box;
}

.ped-auth-input:focus {
  border-color: #2EC4B6;
  box-shadow: 0 0 15px rgba(46, 196, 182, 0.3);
}

.ped-auth-toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(240, 235, 244, 0.5);
  cursor: pointer;
  font-size: 1rem;
}

.ped-auth-msg {
  font-size: 0.78rem;
  margin-bottom: 16px;
  min-height: 18px;
  color: #ff5252;
  font-family: monospace;
}

.ped-auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ped-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.ped-btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(240, 235, 244, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ped-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ped-btn-primary {
  background: linear-gradient(135deg, #2EC4B6, #209287);
  color: #08080e;
  font-weight: 700;
}

.ped-btn-primary:hover {
  background: linear-gradient(135deg, #3eeddc, #25a498);
  box-shadow: 0 0 15px rgba(46, 196, 182, 0.4);
}

.ped-btn-accent {
  background: linear-gradient(135deg, #E8198B, #c01272);
  color: #fff;
  font-weight: 700;
}

.ped-btn-accent:hover {
  box-shadow: 0 0 16px rgba(232, 25, 139, 0.5);
  background: linear-gradient(135deg, #ff239e, #d61480);
}

.ped-btn-gold {
  background: linear-gradient(135deg, #FFB830, #e09b19);
  color: #08080e;
  font-weight: 700;
}

.ped-btn-gold:hover {
  box-shadow: 0 0 16px rgba(255, 184, 48, 0.4);
}

.ped-btn-sm {
  padding: 5px 10px;
  font-size: 0.72rem;
}

.ped-btn-danger {
  background: rgba(255, 75, 75, 0.15);
  border: 1px solid rgba(255, 75, 75, 0.35);
  color: #ff6e6e;
}

.ped-btn-danger:hover {
  background: rgba(255, 75, 75, 0.3);
  color: #fff;
}

/* ==========================================================================
   PORTFOLIO STUDIO MODAL
   ========================================================================== */
#ped-studio-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 10, 0.88);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  color: #F0EBF4;
  overflow: hidden;
}

#ped-studio-modal.ped-visible {
  opacity: 1;
  pointer-events: all;
}

/* Studio Top Bar */
.ped-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(12, 12, 20, 0.85);
  border-bottom: 1.5px solid rgba(232, 25, 139, 0.25);
  flex-shrink: 0;
}

.ped-topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ped-topbar-title h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ped-badge {
  font-size: 0.62rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(46, 196, 182, 0.15);
  border: 1px solid rgba(46, 196, 182, 0.4);
  color: #2EC4B6;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ped-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Studio Body Layout */
.ped-studio-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Studio Sidebar */
.ped-sidebar {
  width: 250px;
  background: rgba(10, 10, 18, 0.7);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  gap: 6px;
  overflow-y: auto;
  flex-shrink: 0;
}

.ped-nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(240, 235, 244, 0.7);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.ped-nav-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
}

.ped-nav-tab.active {
  background: rgba(232, 25, 139, 0.15);
  color: #fff;
  border-color: rgba(232, 25, 139, 0.4);
  box-shadow: 0 0 16px rgba(232, 25, 139, 0.15);
}

.ped-nav-tab .ped-icon {
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
  color: #2EC4B6;
}

.ped-nav-tab.active .ped-icon {
  color: #E8198B;
}

/* Studio Content Area */
.ped-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 26px 32px;
  background: rgba(6, 6, 12, 0.4);
}

.ped-pane {
  display: none;
  animation: ped-fade 0.3s ease;
  max-width: 900px;
}

.ped-pane.active {
  display: block;
}

@keyframes ped-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ped-pane-header {
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ped-pane-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #2EC4B6;
  letter-spacing: 0.02em;
}

.ped-pane-header p {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(240, 235, 244, 0.6);
}

/* Form Styles */
.ped-form-group {
  margin-bottom: 18px;
}

.ped-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ped-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(240, 235, 244, 0.8);
  margin-bottom: 6px;
}

.ped-input,
.ped-textarea,
.ped-select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(18, 18, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  font-family: 'Space Grotesk', inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  box-sizing: border-box;
}

.ped-input:focus,
.ped-textarea:focus,
.ped-select:focus {
  border-color: #2EC4B6;
  box-shadow: 0 0 10px rgba(46, 196, 182, 0.25);
}

.ped-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

/* Card item containers (Projects, Experience, Skills, Links) */
.ped-items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.ped-item-card {
  background: rgba(18, 18, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid #E8198B;
  border-radius: 8px;
  padding: 16px;
  position: relative;
  transition: all 0.25s ease;
}

.ped-item-card:hover {
  border-color: rgba(46, 196, 182, 0.4);
  background: rgba(22, 22, 36, 0.8);
}

.ped-item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ped-item-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ped-item-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ped-tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(240, 235, 244, 0.7);
  border-radius: 4px;
  padding: 4px 7px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Tag list editor */
.ped-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ped-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(46, 196, 182, 0.12);
  border: 1px solid rgba(46, 196, 182, 0.35);
  color: #2EC4B6;
  font-size: 0.72rem;
}

.ped-tag-chip-remove {
  cursor: pointer;
  opacity: 0.6;
  font-weight: bold;
}

.ped-tag-chip-remove:hover {
  opacity: 1;
  color: #ff5252;
}

/* Toast Notification */
#ped-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: rgba(14, 14, 26, 0.95);
  border: 1.5px solid #2EC4B6;
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(46, 196, 182, 0.3), 0 10px 30px rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100005;
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

#ped-toast.ped-toast-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Export Modal */
#ped-export-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 10, 0.85);
  backdrop-filter: blur(14px);
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#ped-export-modal.ped-visible {
  opacity: 1;
  pointer-events: all;
}

.ped-export-card {
  width: 90%;
  max-width: 680px;
  max-height: 82vh;
  background: rgba(14, 14, 24, 0.96);
  border: 1.5px solid rgba(255, 184, 48, 0.4);
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(255, 184, 48, 0.2);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.ped-export-code {
  flex: 1;
  background: #08080e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 14px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.78rem;
  color: #2EC4B6;
  overflow-y: auto;
  white-space: pre;
  margin: 14px 0;
  max-height: 380px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ped-auth-card {
    width: 94%;
    padding: 20px 18px;
  }
  .ped-input,
  .ped-auth-input,
  .ped-textarea,
  .ped-select {
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom on input focus */
  }
  .ped-topbar {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .ped-studio-body {
    flex-direction: column;
  }
  .ped-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px;
    scrollbar-width: none;
  }
  .ped-sidebar::-webkit-scrollbar {
    display: none;
  }
  .ped-nav-tab {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 0.75rem;
  }
  .ped-main-content {
    padding: 16px 14px 40px 14px;
    -webkit-overflow-scrolling: touch;
  }
  .ped-form-row {
    grid-template-columns: 1fr;
  }
  .ped-card {
    padding: 14px 12px;
  }
}

/* ==========================================================================
   EXCLUSIVE DISCREET STUDIO TRIGGER BUTTON
   ========================================================================== */
#ped-studio-trigger {
  display: none !important;
  position: fixed;
  bottom: 16px;
  right: 18px;
  z-index: 40;
  background: rgba(12, 14, 24, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(240, 235, 244, 0.55);
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.22;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  user-select: none;
}

#ped-studio-trigger:hover {
  opacity: 1;
  background: rgba(18, 20, 32, 0.95);
  border-color: #00F5D4;
  color: #FFFFFF;
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.45);
  transform: translateY(-2px);
}

#ped-studio-trigger:active {
  transform: translateY(0) scale(0.98);
}

/* Hide studio button when any section stream is active */
body.about-open #ped-studio-trigger,
body.projects-open #ped-studio-trigger,
body.skills-open #ped-studio-trigger,
body.experience-open #ped-studio-trigger,
body.contact-open #ped-studio-trigger {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transform: translateY(8px) !important;
}

/* Hide on mobile to protect the bottom navigation pills and inputs */
@media (max-width: 820px) {
  #ped-studio-trigger {
    display: none !important;
  }
}

/* ==========================================================================
   INTERACTIVE TAG CHIPS & TAG EDITORS
   ========================================================================== */
.ped-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 8px;
  min-height: 28px;
}

.ped-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: #00F5D4;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ped-tag-chip.ped-tag-pink {
  background: rgba(232, 25, 139, 0.14);
  border-color: rgba(232, 25, 139, 0.4);
  color: #ff3c8c;
}

.ped-tag-chip.ped-tag-gold {
  background: rgba(255, 184, 48, 0.14);
  border-color: rgba(255, 184, 48, 0.4);
  color: #FFB830;
}

.ped-tag-chip.ped-tag-purple {
  background: rgba(186, 104, 255, 0.14);
  border-color: rgba(186, 104, 255, 0.4);
  color: #BA68FF;
}

.ped-tag-chip-del {
  background: none;
  border: none;
  color: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.65;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ped-tag-chip-del:hover {
  opacity: 1;
}

.ped-tag-add-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ped-tag-add-input {
  flex: 1;
  max-width: 220px;
}
