/* ============================================
   ESTL Profile & Portfolio Styles
   ============================================ */

/* === Profile Hero Section === */
.profile-section {
  padding-top: 120px;
  min-height: 100vh;
  padding-bottom: 80px;
}
.profile-container {
  max-width: 900px;
  margin: 0 auto;
}

/* --- Hero Card --- */
.profile-hero {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding: 36px;
  position: relative;
}
.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border: 3px solid var(--border);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: border-color 0.3s ease;
}
.profile-avatar:hover {
  border-color: var(--primary);
}
.avatar-upload-hint {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.profile-details {
  flex: 1;
  min-width: 0;
}
.profile-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 2px;
  font-family: 'Space Grotesk', sans-serif;
}
.profile-username {
  font-size: 15px;
  color: var(--primary-light);
  margin: 0 0 12px;
}
.profile-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 16px;
  max-width: 480px;
}
.profile-socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.profile-socials a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
}
.profile-socials a:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(0, 255, 157, 0.05);
}
.profile-actions {
  position: absolute;
  top: 36px;
  right: 36px;
  display: flex;
  gap: 8px;
}

/* === Stats Bar === */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.stat-item {
  text-align: center;
  padding: 20px 16px;
}
.stat-value {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === Projects Section === */
.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  margin-bottom: 20px;
}
.projects-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* --- Project Card --- */
.project-card {
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.project-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--bg-secondary);
}
.project-cover-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card-hover));
  font-size: 48px;
}
.project-body {
  padding: 20px;
}
.project-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.project-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.project-tag {
  padding: 3px 10px;
  background: rgba(0, 255, 157, 0.08);
  border: 1px solid rgba(0, 255, 157, 0.15);
  border-radius: 999px;
  font-size: 11px;
  color: var(--primary-light);
  font-weight: 600;
}
.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.project-date {
  font-size: 12px;
  color: var(--text-muted);
}
.project-actions {
  display: flex;
  gap: 6px;
}
.project-actions button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.3s ease;
}
.project-actions button:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(0, 255, 157, 0.05);
}
.project-actions .delete-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 0, 85, 0.05);
}

/* --- Add Project Card (Empty state) --- */
.add-project-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  gap: 12px;
}
.add-project-card:hover {
  border-color: var(--primary);
  background: rgba(0, 255, 157, 0.03);
}
.add-project-card .add-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 255, 157, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--primary);
}
.add-project-card span {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Empty State --- */
.empty-projects {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-projects .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
}
.empty-projects p {
  font-size: 15px;
  margin: 0;
}

/* === Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 0;
}
.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.3s;
}
.modal-close:hover {
  color: var(--text-primary);
}
.modal-body {
  padding: 24px 28px;
}
.modal-footer {
  padding: 0 28px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* --- Form Fields --- */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
  box-sizing: border-box;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.1);
}
textarea.form-input {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Image upload area */
.image-upload-area {
  width: 100%;
  height: 160px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.image-upload-area:hover {
  border-color: var(--primary);
}
.image-upload-area .upload-icon {
  font-size: 28px;
  color: var(--text-muted);
}
.image-upload-area .upload-text {
  font-size: 13px;
  color: var(--text-muted);
}
.image-upload-area.has-image .upload-icon,
.image-upload-area.has-image .upload-text {
  display: none;
}

/* === Order History (collapsible) === */
.orders-section {
  margin-top: 40px;
}
.orders-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px 24px;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  transition: all 0.3s ease;
}
.orders-toggle:hover {
  border-color: var(--border-hover);
}
.orders-toggle .toggle-arrow {
  transition: transform 0.3s ease;
  font-size: 14px;
}
.orders-toggle.open .toggle-arrow {
  transform: rotate(180deg);
}
.orders-content {
  display: none;
  padding: 16px 0 0;
}
.orders-content.open {
  display: block;
}
.order-card {
  padding: 20px;
  margin-bottom: 12px;
  border-left: 4px solid var(--primary);
}
.order-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.order-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

/* === Responsive === */
@media (max-width: 768px) {
  .profile-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px;
  }
  .profile-socials {
    justify-content: center;
  }
  .profile-actions {
    position: static;
    justify-content: center;
    margin-top: 16px;
  }
  .profile-bio {
    max-width: 100%;
  }
  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .projects-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .modal {
    max-height: 90vh;
  }
}

/* === Portfolio Builder UI === */
.portfolio-builder-toolbar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 24px;
  display: flex;
  gap: 16px;
  z-index: 1000;
  box-shadow: var(--shadow-card);
}
.toolbar-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border);
}
.toolbar-btn.primary {
  background: var(--primary);
  color: var(--text-on-primary);
}

/* === Cover Photo === */
.cover-photo-wrap {
  position: relative;
  width: 100%;
  height: 250px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--border));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-bottom: -50px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.cover-upload-hint {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.5);
  padding: 8px 16px;
  border-radius: 999px;
  color: white;
  cursor: pointer;
  font-size: 13px;
  display: none;
}
.owner-view .cover-upload-hint {
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-hero {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
}

/* === Skills & Tools === */
.skills-section {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.skill-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.skill-badge .remove-skill {
  cursor: pointer;
  color: var(--danger);
  font-weight: bold;
  display: none;
}
.owner-view .skill-badge .remove-skill {
  display: inline;
}

/* === Themes === */
.theme-selector {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.theme-card {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s;
}
.theme-card:hover {
  transform: scale(1.1);
}
.theme-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary);
}

/* Theme specifics (CSS overrides controlled by JS class on body) */
body.theme-matrix {
  --bg-primary: #000a00;
  --bg-secondary: #001a00;
  --bg-card: #001200;
  --primary: #00ff00;
  --text-primary: #00ff00;
  --text-secondary: #00aa00;
  --border: #00aa00;
}
body.theme-cyberpunk {
  --bg-primary: #0a0a0f;
  --bg-card: #161622;
  --primary: #00ff9d;
  --secondary: #00d2ff;
  --border: rgba(0, 255, 157, 0.2);
}
body.theme-classic {
  --bg-primary: #faf9f5;
  --bg-card: #ffffff;
  --primary: #0f3b73;
  --text-primary: #2b2b2b;
  --border: rgba(0,0,0,0.1);
}

/* Hide elements when not owner */
body:not(.owner-view) .owner-only {
  display: none !important;
}

/* === Builder Sidebar === */
.builder-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -5px 0 30px rgba(0,0,0,0.5);
  z-index: 2000;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding: 20px;
}
.builder-sidebar.active {
  right: 0;
}
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.sidebar-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
}
.sidebar-section {
  margin-bottom: 24px;
}
.sidebar-section h4 {
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Color Pickers */
.color-picker-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  background: var(--bg-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}
.color-picker-group label {
  font-size: 13px;
  font-weight: 500;
}
.color-picker-group input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  cursor: pointer;
}
.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-picker-group input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 5px;
}

/* Custom Links */
.custom-links-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
}
.custom-link-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--primary);
  color: var(--text-on-primary);
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: transform 0.2s, opacity 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
}
.custom-link-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Editor Link Item */
.editor-link-item {
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  position: relative;
}
.editor-link-item input {
  margin-bottom: 8px;
}
.editor-link-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

/* Visibility Toggles */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.toggle-switch {
  position: relative;
  width: 40px;
  height: 20px;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: 0.3s;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch.on {
  background: var(--primary);
}
.toggle-switch.on::after {
  left: 22px;
}

/* Typography options */
.font-selector {
  width: 100%;
  padding: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
}

/* Shift main content when sidebar open */
body.owner-view.sidebar-open {
  padding-right: 350px;
}

/* Override Toolbar when sidebar open */
.builder-toolbar-btn {
  /* same as before */
}


/* ============================================================
   CARRD.CO MODULAR BLOCK BUILDER STYLES
   ============================================================ */

/* --- Modular Canvas Container --- */
.modular-canvas {
  width: 100%;
  max-width: var(--canvas-max-width, 800px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: max-width 0.3s ease;
}

/* Base Block */
.canvas-block {
  position: relative;
  width: 100%;
  transition: all 0.2s ease;
}

.owner-view .canvas-block:hover {
  outline: 2px dashed var(--primary);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.owner-view .canvas-block-actions {
  position: absolute;
  top: -12px;
  right: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  display: none;
  align-items: center;
  gap: 6px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.owner-view .canvas-block:hover .canvas-block-actions {
  display: flex;
}

.canvas-block-actions button {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.canvas-block-actions button:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

/* --- Block: Image --- */
.block-image-wrap {
  width: 100%;
  display: flex;
}
.block-image-wrap.align-center { justify-content: center; text-align: center; }
.block-image-wrap.align-left { justify-content: flex-start; text-align: left; }
.block-image-wrap.align-right { justify-content: flex-end; text-align: right; }

.block-image-content {
  display: inline-block;
  max-width: 100%;
}
.block-image-content img {
  display: block;
  max-width: 100%;
  height: auto;
  transition: transform 0.2s ease;
}
.block-image-content a:hover img {
  transform: scale(1.02);
}

/* Image Sizes */
.block-image-wrap.size-full .block-image-content { width: 100%; }
.block-image-wrap.size-full .block-image-content img { width: 100%; object-fit: cover; max-height: 450px; }
.block-image-wrap.size-large .block-image-content { width: 75%; }
.block-image-wrap.size-medium .block-image-content { width: 50%; }
.block-image-wrap.size-small .block-image-content { width: 220px; }
.block-image-wrap.size-avatar .block-image-content { width: 120px; height: 120px; }
.block-image-wrap.size-avatar .block-image-content img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); }

/* Image Radius */
.block-image-wrap.radius-none img { border-radius: 0; }
.block-image-wrap.radius-rounded img { border-radius: var(--radius-lg, 16px); }
.block-image-wrap.radius-circle img { border-radius: 50%; }

.block-image-caption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* --- Block: Text --- */
.block-text {
  word-wrap: break-word;
  line-height: 1.6;
}
.block-text.align-center { text-align: center; }
.block-text.align-left { text-align: left; }
.block-text.align-right { text-align: right; }

.block-text.style-h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}
.block-text.style-h2 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.block-text.style-h3 {
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.block-text.style-body {
  font-size: 15px;
  color: var(--text-secondary);
}
.block-text.style-quote {
  font-size: 17px;
  font-style: italic;
  color: var(--text-primary);
  border-left: 3px solid var(--primary);
  padding-left: 16px;
  margin: 10px 0;
}

/* --- Block: Buttons / Links --- */
.block-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
}
.block-buttons.layout-column {
  flex-direction: column;
}
.block-buttons.layout-row {
  flex-direction: row;
  flex-wrap: wrap;
}
.block-buttons.align-center { justify-content: center; }
.block-buttons.align-left { justify-content: flex-start; }
.block-buttons.align-right { justify-content: flex-end; }

.block-btn-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  min-width: 140px;
}
.block-buttons.layout-column .block-btn-item {
  width: 100%;
}
.block-btn-item.btn-solid {
  background: var(--primary);
  color: var(--text-on-primary);
  border: 1px solid transparent;
}
.block-btn-item.btn-solid:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}
.block-btn-item.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.block-btn-item.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}
.block-btn-item.btn-ghost {
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.block-btn-item.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

/* --- Block: Divider --- */
.block-divider {
  width: 100%;
  padding: 10px 0;
}
.block-divider hr {
  border: none;
  margin: 0;
}
.block-divider.style-line hr {
  border-top: 1px solid var(--border);
}
.block-divider.style-dashed hr {
  border-top: 1px dashed var(--border);
}
.block-divider.style-dots hr {
  border-top: 2px dotted var(--border);
  width: 60px;
  margin: 0 auto;
}
.block-divider.style-space {
  height: 24px;
}

/* --- Block: Video --- */
.block-video {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #000;
}
.block-video video, .block-video iframe {
  width: 100%;
  display: block;
  border: none;
  aspect-ratio: 16/9;
}

/* --- Block: Card Wrapper (Optional Box Container) --- */
.block-card-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

/* ============================================================
   SIDEBAR BLOCK MANAGER STYLES
   ============================================================ */

.builder-element-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.add-element-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.add-element-btn:hover {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
}

/* Block Item in Sidebar */
.sidebar-block-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.sidebar-block-item.active {
  border-color: var(--primary);
}
.sidebar-block-header {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: rgba(255,255,255,0.02);
}
.sidebar-block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-block-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-block-controls button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.sidebar-block-controls button:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.sidebar-block-controls button.btn-del:hover {
  color: var(--danger);
}

.sidebar-block-body {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: none;
}
.sidebar-block-item.open .sidebar-block-body {
  display: block;
}

.editor-row {
  margin-bottom: 10px;
}
.editor-row label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 600;
}
.editor-select, .editor-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.editor-select:focus, .editor-input:focus {
  border-color: var(--primary);
  outline: none;
}
.editor-segmented {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.editor-segmented button {
  flex: 1;
  background: none;
  border: none;
  padding: 6px;
  font-size: 12px;
  color: var(--text-muted);
  border-radius: 3px;
  cursor: pointer;
}
.editor-segmented button.active {
  background: var(--primary);
  color: var(--text-on-primary);
  font-weight: 600;
}


/* ============================================================
   EXACT CARRD.CO BUILDER UI STYLES
   ============================================================ */

body.carrd-builder-body {
  margin: 0;
  padding: 0;
  background-color: var(--carrd-bg, #e8eaed);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  overflow-x: hidden;
}

body.carrd-builder-body .navbar {
  display: none !important;
}

/* --- Floating Top-Right Toolbar --- */
.carrd-floating-toolbar {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 2px;
  background: #232836;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.carrd-tool-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #9ba6b8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s ease;
  position: relative;
}

.carrd-tool-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.carrd-tool-btn.active {
  background: #3b82f6;
  color: #ffffff;
}

.carrd-tool-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: #11141c;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
}

.carrd-tool-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 3px;
}

/* --- Add Elements Dropdown Menu --- */
.carrd-add-menu {
  position: fixed;
  top: 68px;
  right: 24px;
  width: 240px;
  background: #232836;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 8px;
  z-index: 1200;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.carrd-add-menu.show {
  display: flex;
  animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.carrd-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: all 0.12s ease;
}

.carrd-menu-item:hover {
  background: #3b82f6;
  color: #ffffff;
}

.carrd-menu-item span.icon {
  font-size: 16px;
  width: 20px;
  display: inline-flex;
  justify-content: center;
}

/* --- Properties Drawer (Left or Right Slide-over) --- */
.carrd-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: #1e2230;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
  z-index: 1300;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  color: #f1f5f9;
}

.carrd-drawer.open {
  transform: translateX(0);
}

.carrd-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.carrd-drawer-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.carrd-drawer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.carrd-drawer-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s ease;
}

.carrd-drawer-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.carrd-drawer-btn.done-btn {
  background: #3b82f6;
  color: #ffffff;
}

.carrd-drawer-btn.done-btn:hover {
  background: #2563eb;
}

.carrd-drawer-btn.delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.carrd-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Drawer Form Elements */
.carrd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.carrd-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.carrd-input, .carrd-select, .carrd-textarea {
  width: 100%;
  background: #141722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 9px 12px;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.carrd-input:focus, .carrd-select:focus, .carrd-textarea:focus {
  outline: none;
  border-color: #3b82f6;
}

.carrd-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.carrd-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.carrd-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.carrd-segmented-control {
  display: flex;
  background: #141722;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.carrd-segmented-control button {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.carrd-segmented-control button.active {
  background: #3b82f6;
  color: #ffffff;
  font-weight: 500;
}

/* --- Canvas & Site Card Wrapper --- */
.carrd-canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 90px 20px 80px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.carrd-site-card {
  width: 100%;
  max-width: var(--card-max-width, 680px);
  background: var(--card-bg, #ffffff);
  border-radius: var(--card-radius, 8px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  padding: var(--card-padding, 56px 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: all 0.3s ease;
  position: relative;
  box-sizing: border-box;
}

/* In-Canvas Elements & Hover/Selection Outline */
.canvas-block {
  cursor: pointer;
  position: relative;
  border-radius: 4px;
  transition: outline 0.15s ease, background 0.15s ease;
}

.canvas-block:hover {
  outline: 2px dashed #93c5fd;
  outline-offset: 4px;
}

.canvas-block.selected {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 4px;
}

/* Mobile Preview Mode (Triggered by 📱 icon) */
.mobile-preview-mode .carrd-canvas-wrapper {
  padding: 60px 20px;
}

.mobile-preview-mode .carrd-site-card {
  max-width: 375px !important;
  border-radius: 40px !important;
  border: 12px solid #1e2230 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35) !important;
  padding: 36px 24px !important;
  min-height: 660px;
}


/* ============================================================
   RICH PORTFOLIO BLOCKS & TEMPLATES CSS
   ============================================================ */

/* --- Block: Code Snippet --- */
.block-code {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow: hidden;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
}
.block-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  font-size: 12px;
  color: #8b949e;
}
.block-code-lang {
  text-transform: uppercase;
  font-weight: 700;
  color: #58a6ff;
  letter-spacing: 0.05em;
}
.block-code-copy-btn {
  background: transparent;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.block-code-copy-btn:hover {
  background: #30363d;
  color: #ffffff;
}
.block-code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  color: #e6edf3;
}

/* --- Block: Skills Progress Bars --- */
.block-skills-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.block-skill-item {
  width: 100%;
}
.block-skill-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  margin-bottom: 6px;
}
.block-skill-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.block-skill-bar {
  height: 100%;
  background: var(--primary, #2563eb);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Block: Live Status Pill --- */
.block-status-wrap {
  display: flex;
  width: 100%;
}
.block-status-wrap.align-center { justify-content: center; }
.block-status-wrap.align-left { justify-content: flex-start; }
.block-status-wrap.align-right { justify-content: flex-end; }

.block-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}
.block-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite ease-in-out;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* --- Block: Contact Form --- */
.block-contact-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 20px;
}
.block-contact-form input, .block-contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  background: #ffffff;
  color: #1e293b;
}
.block-contact-form input:focus, .block-contact-form textarea:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
}
.block-contact-btn {
  padding: 10px 18px;
  background: var(--primary, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.block-contact-btn:hover {
  opacity: 0.9;
}

/* --- Block: GitHub Stats Card --- */
.block-github-card {
  width: 100%;
  border: 1px solid #30363d;
  background: #0d1117;
  border-radius: 10px;
  padding: 20px;
  color: #c9d1d9;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.block-github-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.block-github-header svg {
  fill: #ffffff;
}
.block-github-user {
  font-weight: 700;
  font-size: 15px;
  color: #58a6ff;
  text-decoration: none;
}
.block-github-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
  background: #161b22;
  border-radius: 6px;
  padding: 12px;
}
.block-github-stat-num {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}
.block-github-stat-label {
  font-size: 11px;
  color: #8b949e;
  text-transform: uppercase;
}

/* --- Block: FAQ Accordion --- */
.block-faq-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.block-faq-item {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}
.block-faq-question {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  background: rgba(0, 0, 0, 0.01);
}
.block-faq-answer {
  padding: 0 18px 14px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  display: none;
}
.block-faq-item.open .block-faq-answer {
  display: block;
}
.block-faq-item.open .block-faq-question {
  color: var(--primary, #2563eb);
}

/* --- Templates Modal --- */
.carrd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.carrd-modal-backdrop.show {
  display: flex;
}
.carrd-modal {
  background: #1e2230;
  color: #ffffff;
  width: 100%;
  max-width: 650px;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.carrd-modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.carrd-modal-body {
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-height: 70vh;
  overflow-y: auto;
}
.template-card {
  background: #141722;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.template-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}
.template-card-icon {
  font-size: 24px;
}
.template-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}
.template-card-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}
