/* ========================================================
   ToolCanvas — Instagram Profile Preview Style Rules
   Pixel-perfect Instagram app replica
   ======================================================== */

/* ---------- Hidden file inputs ---------- */
.file-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Workspace Layout ---------- */
.tool-workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
  width: 100%;
}

/* Control Bar */
.mockup-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 375px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 1px solid #e8eaed;
  padding: 10px 16px;
  border-radius: 12px;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.02em;
}

/* Theme toggle buttons */
.theme-btn {
  padding: 6px 14px;
  border: 1.5px solid #e0e0e0;
  background-color: #ffffff;
  color: #374151;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.theme-btn:hover {
  border-color: #c0c0c0;
  background-color: #f9fafb;
}

.theme-btn.active {
  border-color: #0095f6;
  background-color: #eff6ff;
  color: #0095f6;
  box-shadow: 0 0 0 1px rgba(0, 149, 246, 0.1);
}

/* Reset button */
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Tips Banner */
.tips-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 375px;
  background: linear-gradient(135deg, #fef9e7 0%, #fffbeb 100%);
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 12px 14px;
}

.tips-icon {
  font-size: 16px;
  line-height: 1.4;
  flex-shrink: 0;
}

.tips-text {
  font-size: 12px;
  color: #92400e;
  line-height: 1.55;
  margin: 0;
}

/* ---------- Phone Frame & Mockup ---------- */
.preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.mockup-frame-outer {
  background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
  border-radius: 44px;
  padding: 12px;
  box-shadow:
    0 25px 60px rgba(0,0,0,0.18),
    0 8px 20px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.05);
  border: 2.5px solid #3a3a3a;
  width: 100%;
  max-width: 375px;
  position: relative;
}

/* Notch / Dynamic Island */
.mockup-device-header {
  height: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 10;
}

.device-notch {
  width: 120px;
  height: 28px;
  background-color: #000000;
  border-radius: 0 0 18px 18px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-notch::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #1a2634 40%, #0d1520 100%);
  border: 1px solid #222;
}

/* The Live Instagram screen */
.instagram-mockup {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  font-size: 14px;
  position: relative;
  min-height: 680px;
}

/* ===== LIGHT THEME ===== */
.mockup-light {
  --ig-bg: #ffffff;
  --ig-text: #000000;
  --ig-text-secondary: #262626;
  --ig-text-muted: #737373;
  --ig-link: #00376b;
  --ig-blue: #0095f6;
  --ig-border: #dbdbdb;
  --ig-separator: #efefef;
  --ig-button-bg: #efefef;
  --ig-button-text: #262626;
  --ig-button-hover: #dbdbdb;
  --ig-status-bar-bg: #ffffff;

  --btn-follow-bg: #0095f6;
  --btn-follow-text: #ffffff;
  --btn-follow-hover: #1877f2;
  --btn-secondary-bg: #efefef;
  --btn-secondary-border: transparent;
  --btn-secondary-text: #262626;
  --btn-secondary-hover: #dbdbdb;
}

/* ===== DARK THEME ===== */
.mockup-dark {
  --ig-bg: #000000;
  --ig-text: #f5f5f5;
  --ig-text-secondary: #e0e0e0;
  --ig-text-muted: #a8a8a8;
  --ig-link: #e0f1ff;
  --ig-blue: #0095f6;
  --ig-border: #262626;
  --ig-separator: #1c1c1e;
  --ig-button-bg: #363636;
  --ig-button-text: #f5f5f5;
  --ig-button-hover: #262626;
  --ig-status-bar-bg: #000000;

  --btn-follow-bg: #0095f6;
  --btn-follow-text: #ffffff;
  --btn-follow-hover: #1877f2;
  --btn-secondary-bg: #363636;
  --btn-secondary-border: transparent;
  --btn-secondary-text: #f5f5f5;
  --btn-secondary-hover: #2c2c2e;
}

.instagram-mockup {
  background-color: var(--ig-bg);
  color: var(--ig-text);
}

/* ---------- Status Bar ---------- */
.mockup-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px 4px;
  background-color: var(--ig-bg);
  font-size: 14px;
  font-weight: 600;
  color: var(--ig-text);
  letter-spacing: 0.01em;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-icon-svg {
  color: var(--ig-text);
}

.battery-icon {
  width: 22px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 2.5px;
  position: relative;
}

.battery-icon::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background-color: currentColor;
  border-radius: 1px;
}

.battery-icon::after {
  content: '';
  position: absolute;
  top: 2.5px;
  left: 100%;
  margin-left: 1px;
  width: 2px;
  height: 4px;
  background-color: currentColor;
  border-radius: 0 1px 1px 0;
}

/* ---------- Top Navigation Bar ---------- */
.mockup-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 8px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.top-bar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.mockup-username {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 4px;
  padding: 1px 3px;
  transition: background-color 0.15s ease;
  line-height: 1.3;
}

/* ===== VERIFIED BADGE — Instagram Official Design ===== */
.mockup-verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 2px;
}

.mockup-verified-badge svg {
  display: block;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.icon-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ig-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.icon-btn:hover {
  opacity: 0.6;
}

.icon-svg {
  color: var(--ig-text);
}

/* ---------- Profile Section ---------- */
.mockup-profile-container {
  display: flex;
  flex-direction: column;
}

/* Avatar and Stats row */
.mockup-profile-header {
  display: flex;
  align-items: center;
  padding: 16px 16px 0;
  gap: 20px;
}

.mockup-avatar-container {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mockup-avatar-container.no-story {
  background: var(--ig-border);
  padding: 2px;
}

.mockup-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--ig-bg);
  border: 3px solid var(--ig-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mockup-avatar-inner img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.mockup-avatar-inner img.has-placeholder {
  display: none;
}

/* Avatar placeholder */
.avatar-placeholder-svg {
  width: 100%;
  height: 100%;
  background-color: var(--ig-button-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ig-text-muted);
}

.avatar-placeholder-svg svg {
  width: 36px;
  height: 36px;
  opacity: 0.4;
}

.mockup-avatar-container:hover .avatar-overlay {
  opacity: 1;
}

.avatar-overlay {
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  background-color: rgba(0,0,0,0.45);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 50%;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* Right side of profile header (Name + Stats) */
.mockup-info-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

/* Stats row */
.mockup-stats-row {
  display: flex;
  gap: 28px;
  justify-content: flex-start;
}

.stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-val {
  font-weight: 700;
  font-size: 16px;
  border-radius: 4px;
  padding: 1px 4px;
  transition: background-color 0.15s ease;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.stat-lbl {
  font-size: 13px;
  color: var(--ig-text);
  font-weight: 400;
  margin-top: 0;
  letter-spacing: 0;
}

/* ---------- Bio Section ---------- */
.mockup-bio-area {
  padding: 8px 16px 4px;
  font-size: 14px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mockup-fullname {
  font-weight: 600;
  font-size: 14px;
  border-radius: 4px;
  padding: 1px 3px;
  transition: background-color 0.15s ease;
  line-height: 1.3;
  margin: 0;
}

.mockup-category {
  color: var(--ig-text-muted);
  font-size: 14px;
  font-weight: 400;
  border-radius: 4px;
  padding: 1px 3px;
  transition: background-color 0.15s ease;
  width: fit-content;
}

.mockup-bio-text {
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 4px;
  padding: 1px 3px;
  transition: background-color 0.15s ease;
  font-size: 14px;
  line-height: 1.35;
  margin: 0;
}

.mockup-bio-text a {
  color: var(--ig-link);
  text-decoration: none;
  font-weight: 600;
}

.mockup-website {
  color: var(--ig-link);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-top: 0;
  border-radius: 4px;
  padding: 1px 3px;
  transition: background-color 0.15s ease;
  width: fit-content;
  cursor: text;
}

/* Contenteditable hover/focus styles */
[contenteditable="true"]:hover {
  outline: 1.5px dashed #0095f6;
  outline-offset: 1px;
  cursor: text;
}

[contenteditable="true"]:focus {
  outline: 1.5px solid #0095f6;
  outline-offset: 1px;
  background-color: rgba(0, 149, 246, 0.04);
}

/* ---------- Action Buttons ---------- */
.mockup-actions-row {
  display: flex;
  padding: 12px 16px 4px;
  gap: 6px;
  align-items: center;
}

.mockup-btn {
  height: 34px;
  padding: 0 16px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  letter-spacing: -0.01em;
}

.btn-follow {
  flex: 1;
  background-color: var(--btn-follow-bg);
  color: var(--btn-follow-text);
}

.btn-message {
  flex: 1;
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: none;
}

.btn-user-add {
  width: 34px;
  height: 34px;
  padding: 0;
  flex-grow: 0;
  flex-shrink: 0;
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: none;
  border-radius: 10px;
}

/* ---------- Story Highlights ---------- */
.mockup-highlights-wrapper {
  padding: 12px 16px 12px;
  border-bottom: 0.5px solid var(--ig-border);
}

.mockup-highlights-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.mockup-highlights-scroll::-webkit-scrollbar {
  display: none;
}

.mockup-highlight-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 64px;
  flex-shrink: 0;
  position: relative;
}

.mockup-highlight-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--ig-border);
  padding: 3px;
  background-color: var(--ig-bg);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mockup-highlight-circle img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.mockup-highlight-circle img.has-placeholder {
  display: none;
}

/* Highlight placeholder */
.highlight-placeholder-svg {
  width: 100%;
  height: 100%;
  background-color: var(--ig-button-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ig-text-muted);
}

.highlight-placeholder-svg svg {
  width: 20px;
  height: 20px;
  opacity: 0.4;
}

.mockup-highlight-circle:hover::after {
  content: '📷';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.35);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 50%;
  z-index: 5;
  pointer-events: none;
}

.mockup-highlight-title {
  font-size: 12px;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  padding: 0 2px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  font-weight: 400;
}

/* Delete highlight */
.highlight-delete {
  position: absolute;
  top: -4px;
  right: -2px;
  background: #ed4956;
  color: #ffffff;
  border: 2px solid var(--ig-bg);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  line-height: 1;
}

.mockup-highlight-item:hover .highlight-delete {
  opacity: 1;
}

/* Add highlight button */
.mockup-highlight-item.add-highlight-btn {
  cursor: pointer;
}

.mockup-highlight-item.add-highlight-btn .mockup-highlight-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 300;
  color: var(--ig-text-muted);
  border: 1.5px dashed var(--ig-border);
  background-color: transparent;
}

.mockup-highlight-item.add-highlight-btn:hover .mockup-highlight-circle {
  background-color: var(--ig-button-bg);
  color: var(--ig-text);
}

.mockup-highlight-item.add-highlight-btn .mockup-highlight-circle::after {
  display: none !important;
}

/* ---------- Tab Icons Row ---------- */
.mockup-tabs-bar {
  display: flex;
  border-top: 0.5px solid var(--ig-border);
}

.tab-item {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 44px;
  color: var(--ig-text-muted);
  cursor: default;
}

.tab-item.active {
  color: var(--ig-text);
  border-top: 1px solid var(--ig-text);
  margin-top: -0.5px;
}

/* ---------- Photo Grid ---------- */
.mockup-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: var(--ig-bg);
}

.mockup-grid-photo {
  aspect-ratio: 1 / 1;
  background-color: var(--ig-separator);
  position: relative;
  overflow: hidden;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mockup-grid-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mockup-grid-photo img.has-placeholder {
  display: none;
}

/* Grid placeholder */
.grid-placeholder-svg {
  width: 100%;
  height: 100%;
  background-color: var(--ig-separator);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ig-text-muted);
}

.grid-placeholder-svg svg {
  width: 24px;
  height: 24px;
  opacity: 0.25;
}

.mockup-grid-photo.dragging {
  opacity: 0.5;
  outline: 2px dashed #0095f6;
  outline-offset: -2px;
}

/* Add grid photo button */
.mockup-grid-photo.add-grid-photo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: var(--ig-separator);
  color: var(--ig-text-muted);
  transition: all 0.15s ease;
  gap: 4px;
}

.mockup-grid-photo.add-grid-photo-btn:hover {
  background-color: var(--ig-button-bg);
  color: var(--ig-text);
}

.add-grid-photo-btn .plus-icon {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.add-grid-photo-btn .label-text {
  font-size: 10px;
  font-weight: 500;
}

/* Delete grid photo */
.grid-photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  line-height: 1;
  backdrop-filter: blur(4px);
}

.mockup-grid-photo:hover .grid-photo-delete {
  opacity: 1;
}

.grid-photo-delete:hover {
  background: rgba(237, 73, 86, 0.9);
}

/* ---------- Bottom Navigation Bar ---------- */
.mockup-bottom-nav {
  height: 50px;
  border-top: 0.5px solid var(--ig-border);
  background-color: var(--ig-bg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 12px;
  flex-shrink: 0;
}

.bottom-nav-item {
  color: var(--ig-text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  cursor: default;
}

.bottom-nav-item.plus-box svg {
  border: 1.5px solid currentColor;
  border-radius: 7px;
  padding: 2px;
}

.bottom-nav-item.mini-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--ig-text);
}

.bottom-nav-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Download Container ---------- */
.download-container {
  margin-top: 24px;
  width: 100%;
  max-width: 375px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  text-align: center;
  border-radius: 12px;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .mockup-frame-outer {
    border-radius: 0;
    padding: 0;
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    max-width: 100%;
  }

  .instagram-mockup {
    border-radius: 0;
  }

  .mockup-device-header {
    display: none;
  }

  .mockup-control-bar,
  .tips-banner,
  .download-container {
    max-width: 100%;
  }
}
