:root {
  --bg:#0d0f11; --panel:#111315; --glass:rgba(0,0,0,0.45);
  --hover:#1a1d1f; --border:#222526; --accent:#c8ff00; --accent2:#d4ff33;
  --radius:14px; --blur:14px; --text-muted:#9aa2ac;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #fff;
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  transform: translateY(-3px);
  width: 13px;
  height: 13px;
  background: rgb(125, 255, 32);
  border-radius: 50%;
  border: none;
}


/* NAVBAR */
.navbar{padding:14px 22px;border-bottom:1px solid var(--border);background:var(--panel);display:flex;justify-content:space-between;align-items:center;width: 100%; margin:auto; max-width:980px;}
.logo{font-weight:700;font-size:20px;}

/* TEMPLATE STRIP */
.templates-strip-desc p {padding: 10px 20px; margin: 0;opacity: 0.7;width: 100%; margin:auto; max-width:980px;}
.templates-strip{padding:10px 20px;border-bottom:1px solid var(--border);display:flex;gap:12px;overflow-x:auto;background:#0f1113;width: 100%; margin:auto; max-width:980px;}
.template-item{min-width:100px;height:100px;border-radius:var(--radius);overflow:hidden;cursor:pointer;border:2px solid transparent;transition:.2s;background:#000;}
.template-item.selected{border-color:var(--accent);} .template-item img{width:100%;height:100%;object-fit:cover;}

/* FEED GRID */
.feed{flex:1;overflow-y:auto;padding:20px; padding-bottom: 120px; max-width: 980px; width: 100%; margin: auto;} .grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px;width: 100%;justify-content: left;}
.card{position:relative;background:var(--panel);border-radius:var(--radius);overflow:hidden;cursor:pointer;}
.card img{width:100%;height:100%; object-fit:cover;display:block;border-radius:var(--radius);} 

/* Hover overlay */
.card-overlay{position:absolute;bottom:0;left:0;width:100%;padding:10px;display:flex;gap:10px;align-items:center;justify-content:flex-start;background:var(--glass);backdrop-filter:blur(var(--blur));opacity:0;transition:.25s;}
.card:hover .card-overlay{opacity:1;}
.icon-btn:hover{background:rgba(255,255,255,0.18);} 

/* Skeleton */
.skel{width:100%;min-height: 290px;height:100%;background:linear-gradient(90deg,#1a1d1f 0%,#2a2d30 50%,#1a1d1f 100%);background-size:200% 100%;animation:shimmer 1.4s infinite;border-radius:var(--radius);} @keyframes shimmer{0%{background-position:-200%}100%{background-position:200%}}

/* Composer */
.composer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 50;
  margin: auto;
  max-width: 980px;
  right: 0;
}

/* Avatar stays the same */
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: #6363636d;
  color: #ffffffc2;
  border: 2px solid transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.avatar img {
  object-fit: cover;
  width: 100%;
}

/* ChatGPT-style input box */
.prompt-box {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #0f1113;
  border: 1px solid #2a2d30;
  border-radius: 14px;
  gap: 10px;
  position: relative;
  transition: border-color .2s;
}

.prompt-box:focus-within {
  border-color: #444;
}

.prompt-box textarea {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  max-height: 150px;
}

/* Send button like ChatGPT */
.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #196be6;
  border: 1px solid #303236;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #c8c8cc;
  transition: .2s;
  transform: rotate(270deg);
}

.send-btn:hover {
  background: #2a74e4;
  color: white;
}
/* Fullscreen Popup */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  overflow: hidden;
  position: relative;
}

/* Image side - full screen */
.modal-image-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #0a0b0c;
  position: relative;
}

.modal-image {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ChatGPT-style centered bottom controls */
.modal-controls {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 768px;
  padding: 0 20px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  pointer-events: none;
  z-index: 101;
}

.modal-controls > * {
  pointer-events: auto;
}

.modal-controls-block {
  display: none;
}

.modal-controls.active {
  overflow: visible;
}

@keyframes skeleton-loading {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Close button */
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 20px;
  z-index: 101;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

/* Modern ChatGPT-style prompt section */
.modal-prompt-section {
  width: 100%;
  background: #2f2f2f;
  border: 1px solid #4a4a4a;
  border-radius: 26px;
  padding: 4px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05), 0 8px 32px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
  padding-top: 0;
}

.modal-prompt-section:focus-within {
  background: #343434;
  border-color: #5a5a5a;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 12px 40px rgba(0,0,0,0.4);
}

.prompt-input-wrapper {
  position: relative;
  background: transparent;
  border-radius: 22px;
  overflow: unset;
}

.prompt-input-wrapper textarea {
  width: 80%;
  min-height: 24px;
  max-height: 200px;
  padding: 2px 50px 6px 16px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 15px;
  line-height: 24px;
  resize: none;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-y: auto;
}

.prompt-input-wrapper textarea::placeholder {
  color: #8e8e8e;
}

.prompt-input-wrapper textarea::-webkit-scrollbar {
  width: 4px;
}

.prompt-input-wrapper textarea::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

/* Attach button - minimal */
.attach-btn {
  position: absolute;
  right: 46px;
  bottom: 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  color: #8e8e8e;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

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

.attach-btn svg {
  width: 20px;
  height: 20px;
}

/* Send button - ChatGPT style */
.send-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #000;
  transition: all 0.15s ease;
  transform: none;
}

.send-btn:hover {
  background: #f0f0f0;
}

.send-btn:disabled {
  background: #676767;
  cursor: not-allowed;
  opacity: 0.4;
}

.send-btn svg {
  width: 16px;
  height: 16px;
}

/* Attach preview - cleaner */
.attach-preview {
  display: flex;
  gap: 6px;
  padding: 8px 16px 4px 16px;
  flex-wrap: wrap;
}

.attach-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 0.15s ease;
}

.attach-preview img:hover {
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.05);
}

/* Preset prompts - minimal chips */
.preset-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 8px 4px 8px;
}

.preset-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.preset-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Actions - horizontal row below prompt */
.modal-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
}

.modal-action-btn {
  padding: 5px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.modal-action-btn svg {
  width: 14px;
  height: 14px;
}

.modal-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.modal-action-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: #ffffff;
  font-weight: 600;
}

.modal-action-btn.primary:hover {
  filter: brightness(1.1);
}

/* Aspect ratio section - hide by default, show on toggle */
.aspect-ratio-section {
  display: none;
  background: rgba(17, 19, 21, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(20px);
  margin-bottom: 8px;
}

.aspect-ratio-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
}

.current-ratio {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #b0b0b0;
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}

.ratio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ratio-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.ratio-card.active {
  border-color: var(--accent);
  background: rgba(0, 85, 255, 0.1);
}

.modal-controls.draw .modal-actions {
  display: none !important;
}

.modal-controls.draw .preset-prompts {
  display: none !important;
}
.modal-controls.draw .modal-prompt-section {
  border: 2px solid #b8ff74 !important;
}

.ratio-preview {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  margin-bottom: 6px;
}

.ratio-1-1 { width: 32px; height: 32px; }
.ratio-16-9 { width: 40px; height: 22px; }
.ratio-9-16 { width: 22px; height: 40px; }
.ratio-4-5 { width: 30px; height: 38px; }
.ratio-3-4 { width: 30px; height: 40px; }
.ratio-2-3 { width: 26px; height: 40px; }

.ratio-label {
  font-size: 12px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 2px;
}

.ratio-desc {
  font-size: 10px;
  color: #8e8e8e;
}

/* Options - minimal footer info */
.modal-options {
  display: none;
  justify-content: center;
  gap: 16px;
  padding: 8px 0 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.option-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
}

.option-label {
  color: #8e8e8e;
  font-size: 12px;
}

.option-value {
  color: #e0e0e0;
  font-size: 12px;
  font-weight: 500;
}

.modal-btn{padding:10px 16px;border-radius:10px;border:none;cursor:pointer;font-weight:600;}
.modal-primary{background:linear-gradient(90deg,var(--accent),var(--accent2));color:#fff;} .modal-ghost{background:rgba(255,255,255,0.08);color:#fff;}

/* Loading state */
.modal-loading {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-loading.active {
  opacity: 1;
  pointer-events: all;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 824px) {
  .modal-controls {
    max-width: calc(100% - 32px);
    padding: 0 16px 16px 16px;
  }

  .modal-actions {
    gap: 4px;
  }

  .modal-action-btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .ratio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }
  .ai-bar {
    top: -40px !important;
  }

  .modal-controls {
    padding: 0 12px 12px 12px;
  }

  .preset-prompts {
    padding: 0 4px 6px 4px;
  }

  .modal-options {
    flex-direction: column;
    gap: 4px;
    align-items: center;
  }
}

/* Avatar Manager */


/* AI top bar */
.ai-bar {
  position: absolute;
  top: -40px;
  right: 0;
  width: 100%;
  display: flex;
  justify-content: end;
  gap: 10px;
  align-items: center;
  padding: 0;
}

/* Model select */
.ai-model select {
  background: #0f1113;
  border: 1px solid #2a2d30;
  color: #fff;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.ai-model select:hover {
  border-color: #3a3d40;
}

/* Attach button */
.ai-attach {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #0f1113;
  border: 1px solid #2a2d30;
  color: #c8c8cc;
  cursor: pointer;
  font-size: 13px;
  transition: .2s;
}

.ai-attach:hover {
  background: #1a1d1f;
  color: #fff;
}

/* Composer fix for bar */
.composer {
  position: fixed;
  bottom: 0;
}

.ai-input-dropdown {
  position: relative;
  width: 240px;
}

.ai-input-dropdown input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: #0f1113;
  border: 1px solid #2a2d30;
  color: #fff;
  cursor: pointer;
}

.ai-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  width: 100%;
  background: #0d0f11;
  border: 1px solid #2a2d30;
  border-radius: 12px;
  display: none;
  padding: 6px;
  box-shadow: 0 20px 40px rgba(0,0,0,.45);
  z-index: 50;
}

.ai-input-dropdown.open .ai-dropdown-menu {
  display: block;
}

.ai-option {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

.ai-option:hover {
  background: #1a1d1f;
}

.ai-option span {
  color: #ffd24d;
}

.ai-option.disabled {
  opacity: .4;
  cursor: not-allowed;
}


.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999999;
}

.popup {
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  background: #111;
  color: #fff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.popup-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #222;
}

.close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
}

.grid {
  padding: 16px;
  display: grid;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Mobile = 2 columns */
@media (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.img-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
}

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

.img-item.selected {
  border-color: #4a7dff;
}

.img-item.selected::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  background: #4a7dff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: bold;
}

.popup-actions {
  padding: 14px;
  border-top: 1px solid #222;
  display: flex;
  justify-content: flex-end;
}

.apply-btn {
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  background: #4a7dff;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.apply-btn:disabled {
  background: #333;
  cursor: not-allowed;
}
.img-animate {
  display: block;
}
.img-animate::before,
.img-animate::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  z-index: 9999;
  border-radius: inherit;
  backdrop-filter: blur(10px);
}

.img-animate::before {
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 70%),
    #00000085;
  animation: aurora 6s ease-in-out infinite;
}

.img-animate::after {
  background-image: 
    radial-gradient(circle, rgba(255,255,255,0.9) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.5) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.3) 1px, transparent 1px);
  background-size: 40px 40px, 28px 28px, 20px 20px;
  animation: drift 10s ease-in-out infinite, twinkle 4s ease-in-out infinite;
}

@keyframes aurora {
  0%, 100% { 
    background: 
      radial-gradient(ellipse at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 50%),
      radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 70%),
      #00000085;
  }
  33% { 
    background: 
      radial-gradient(ellipse at 70% 20%, rgba(255,255,255,0.12) 0%, transparent 50%),
      radial-gradient(ellipse at 30% 80%, rgba(255,255,255,0.15) 0%, transparent 50%),
      radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 70%),
      #00000085;
  }
  66% { 
    background: 
      radial-gradient(ellipse at 40% 70%, rgba(255,255,255,0.1) 0%, transparent 50%),
      radial-gradient(ellipse at 60% 30%, rgba(255,255,255,0.12) 0%, transparent 50%),
      radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.06) 0%, transparent 70%),
      #00000085;
  }
}

@keyframes drift {
  0%, 100% { background-position: 0 0, 10px 14px, 5px 8px; }
  50% { background-position: 20px 10px, 5px 20px, 15px 5px; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

@keyframes blurPulse { from { filter: (20px); } to { filter: blur(10px); } }

.modal-image-container {
    position: relative; overflow: hidden; cursor: grab; height: calc(100vh - 150px);
  max-height: calc(100vh - 150px);  
  overflow: hidden;     
}
.modal-image-container.grabbing { cursor: grabbing; }
.modal-image-container.brush-mode { cursor: crosshair !important; }

.canvas-wrapper {
    position: absolute; top: 50%; left: 50%;
    transform-origin: center center; transition: transform 0.1s ease-out; will-change: transform;
}

#imageCanvas, #brushCanvas { 
    display: block; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast; 
    image-rendering: crisp-edges; 
}
.modal-image { display: none; }


.zoom-controls.left {
  cursor:default;  top: 80px; left: 10px; display: flex; flex-direction: column;
}

.zoom-controls.left span {
  display: none;
  font-size: 14px;
  opacity: 0.8;
  padding: 0 10px;
  padding-left: 0;
}
.zoom-controls.left:hover span {
  display: flex;
}
.zoom-controls.left:hover {
  width: auto !important;
}
.zoom-controls.left:hover button {
  padding-left: 10px;
}
.zoom-controls.left:hover button span {
  margin-left: 10px;
}
.zoom-btn, .reset-btn, .brush-btn {
    width: 36px; height: 36px; border-radius: 38px;
    background: rgba(255, 255, 255, 0.1); border: none;
    color: white; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.zoom-btn:hover, .reset-btn:hover, .brush-btn:hover {
    background: rgba(255, 255, 255, 0.158); transform: scale(1.01);
}
.brush-btn.active { background: rgba(0, 123, 255, 0.5); border-color: rgba(0, 123, 255, 0.8); }

.brush-controls {
    position: absolute; top: 20px; right: 20px; background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px); border-radius: 32px; padding: 15px; z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1); display: none; min-width: 180px;
}

.zoom-controls.left:hover button {
  width: auto;
  display: flex;
  justify-content: left;
}

.brush-controls.active { display: block; }
.brush-control-item { margin-bottom: 10px; }
.brush-control-item:last-child { margin-bottom: 0; }
.brush-control-item label { font-size: 12px; display: block; margin-bottom: 5px; color: white; }
.brush-control-item input[type="range"] { width: 100%; }
.brush-control-item input[type="color"] { width: 100%; height: 30px; cursor: pointer; border-radius: 6px; }
.brush-control-item button {
    padding: 8px 16px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1); color: white; cursor: pointer;
    width: 100%; margin-top: 5px; font-size: 12px;
}
.brush-control-item button:hover { background: rgba(255,255,255,0.2); }

.zoom-display {
    position: absolute; bottom: 20px; left: 20px;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(10px); color: white;
    padding: 8px 12px; border-radius: 8px; font-size: 12px; font-family: monospace;
    z-index: 100; border: 1px solid rgba(255, 255, 255, 0.1); min-width: 60px; text-align: center;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.45);
}

.text-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    min-width: 200px;
}

.text-controls.active {
    display: block;
}

.text-controls select {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 12px;
    cursor: pointer;
}

.text-controls select option {
    background: #1a1a1a;
    color: white;
}

.text-style-btns {
    display: flex;
    gap: 8px;
}

.text-style-btn {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.text-style-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.text-style-btn.active {
    background: rgba(123, 97, 255, 0.3);
    border-color: rgba(123, 97, 255, 0.5);
}

.text-input-overlay {
    position: absolute;
    background: transparent;
    border: 2px dashed rgba(123, 97, 255, 0.8);
    padding: 10px;
    cursor: move;
    min-width: 100px;
    min-height: 40px;
    z-index: 50;
}

.text-input-overlay textarea {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 48px;
    resize: none;
    outline: none;
    width: auto;
    height: auto;
    min-width: 100px;
    min-height: 40px;
    font-family: Arial;
    cursor: text;
    overflow: hidden;
    word-wrap: break-word;
}

.text-input-overlay .text-handles {
    position: absolute;
    background: #7b61ff;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 100;
}

.text-input-overlay .rotate-handle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    cursor: grab;
    user-select: none;
    padding: 4px;
}

.text-input-overlay .rotate-handle:active {
    cursor: grabbing;
    background: #6b51ef;
}

.text-input-overlay .rotate-handle:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(123, 97, 255, 0.6);
}

.text-input-overlay .rotate-tl {
    top: -12px;
    left: -12px;
}

.text-input-overlay .rotate-tr {
    top: -12px;
    right: -12px;
}

.text-input-overlay .rotate-bl {
    bottom: -12px;
    left: -12px;
}

.text-input-overlay .rotate-br {
    bottom: -12px;
    right: -12px;
}

.text-input-overlay .handle-move {
    width: 24px;
    height: 24px;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-input-overlay .handle-move::after {
    content: '⋮⋮';
    font-size: 12px;
    color: white;
}

.text-input-overlay .handle-move:hover {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 0 10px rgba(123, 97, 255, 0.6);
}

.text-input-overlay .resize-handle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    cursor: nwse-resize;
    user-select: none;
    padding: 4px;
    background: #00d9ff;
    border: 2px solid white;
    border-radius: 50%;
}

.text-input-overlay .resize-handle:active {
    cursor: nwse-resize;
    background: #00b9df;
}

.text-input-overlay .resize-handle:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.6);
}

.text-input-overlay .resize-br {
    bottom: -12px;
    right: -12px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: -15px -15px 10px -15px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px 12px 0 0;
    cursor: move;
    user-select: none;
}

.control-header:active {
    cursor: grabbing;
}

.control-header span:first-child {
    font-weight: 600;
    font-size: 13px;
}

.drag-icon {
    opacity: 0.5;
    font-size: 16px;
    line-height: 1;
}

.brush-controls, .text-controls {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.brush-controls.active, .text-controls.active {
    display: block;
}

.brush-controls.dragging, .text-controls.dragging {
    box-shadow: 0 12px 48px rgba(123, 97, 255, 0.3);
    border-color: rgba(123, 97, 255, 0.5);
}

.crop-controls {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.crop-controls.active {
    display: block;
}

.crop-templates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.crop-template-btn {
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.crop-template-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.crop-template-btn.active {
    background: rgba(0, 217, 255, 0.3);
    border-color: rgba(0, 217, 255, 0.5);
}

.crop-overlay {
    position: absolute;
    border: 2px solid #00d9ff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    z-index: 60;
}

.crop-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #00d9ff;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 70;
}

.crop-handle.nw { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-handle.ne { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.crop-handle.n { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.crop-handle.s { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.crop-handle.w { top: 50%; left: -6px; transform: translateY(-50%); cursor: ew-resize; }
.crop-handle.e { top: 50%; right: -6px; transform: translateY(-50%); cursor: ew-resize; }

.crop-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crop-grid::before,
.crop-grid::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
}

.crop-grid::before {
    left: 33.33%;
    top: 0;
    bottom: 0;
    width: 1px;
    box-shadow: 66.67% 0 0 rgba(255, 255, 255, 0.3);
}

.crop-grid::after {
    top: 33.33%;
    left: 0;
    right: 0;
    height: 1px;
    box-shadow: 0 66.67% 0 rgba(255, 255, 255, 0.3);
}

.filters-controls {
    position: fixed;
    top: 100px;
    right: 120px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    min-width: 220px;
    max-width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.filters-controls.active {
    display: block;
    pointer-events: auto;
    overscroll-behavior: contain; 
}

.filter-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 5px;
}

.filter-preset-btn {
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.filter-preset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.filter-preset-btn.active {
    background: rgba(123, 97, 255, 0.3);
    border-color: rgba(123, 97, 255, 0.5);
}

.stickers-controls {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    min-width: 240px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.stickers-controls.active {
    display: block;
}

.sticker-templates {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.sticker-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 24px;
    transition: all 0.2s;
}

.sticker-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(123, 97, 255, 0.5);
    transform: scale(1.1);
}

.sticker-item.active {
    background: rgba(123, 97, 255, 0.3);
    border-color: rgba(123, 97, 255, 0.8);
}

.sticker-overlay {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 50;
    border: 2px dashed rgba(123, 97, 255, 0.8);
}

.sticker-overlay img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.sticker-overlay .sticker-resize-handle {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #7b61ff;
    border: 2px solid white;
    border-radius: 50%;
    cursor: nwse-resize;
    z-index: 10;
}

.sticker-overlay .sticker-resize-handle:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(123, 97, 255, 0.6);
}

.sticker-overlay .sticker-delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: #ff4757;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
}

.sticker-overlay .sticker-delete-btn:hover {
    background: #ff3838;
    transform: scale(1.1);
}

.aspect-ratio-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 340px;
    background: rgba(17, 19, 21, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aspect-ratio-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px 16px 0 0;
    cursor: move;
    user-select: none;
}

.panel-header:active {
    cursor: grabbing;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.panel-title svg {
    opacity: 0.8;
}

.panel-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-ratio {
    font-size: 11px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #b0b0b0;
    background: rgba(255, 255, 255, 0.05);
}

.panel-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close:hover {
    background: rgba(255, 100, 100, 0.3);
    transform: rotate(90deg);
}

.panel-content {
    padding: 16px;
}

.ratio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ratio-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ratio-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ratio-card.active {
    border-color: #c8ff00;
    background: var(--accent);
}

.ratio-preview {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.ratio-card:hover .ratio-preview {
    background: var(--accent);
    border-color:var(--accent2);
}

.ratio-card.active .ratio-preview {
    background: var(--accent);
    border-color: #c8ff00;
}

.ratio-1-1 { width: 36px; height: 36px; }
.ratio-16-9 { width: 44px; height: 25px; }
.ratio-9-16 { width: 25px; height: 44px; }
.ratio-4-5 { width: 32px; height: 40px; }
.ratio-3-4 { width: 32px; height: 42px; }
.ratio-2-3 { width: 28px; height: 42px; }

.ratio-label {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.ratio-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

/* Dragging state */
.aspect-ratio-panel.dragging {
    box-shadow: 0 12px 48px rgba(0, 85, 255, 0.3);
    border-color: rgba(0, 85, 255, 0.5);
}

.aspect-ratio-controls {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    min-width: 240px;
    max-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.aspect-ratio-controls.active {
    display: block;
}

.ratio-templates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.ratio-template-btn {
    padding: 10px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.3;
}

.ratio-template-btn small {
    font-size: 9px;
    opacity: 0.7;
    font-weight: 400;
}

.ratio-template-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.ratio-template-btn.active {
    background: rgba(0, 85, 255, 0.3);
    border-color: rgba(0, 85, 255, 0.6);
}



/* Mobile responsive */
@media (max-width: 767px) {
    .zoom-controls.left {
      display: none;
    }
    .aspect-ratio-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
    
    .ratio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.lasso-controls {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    min-width: 220px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lasso-controls.active {
    display: block;
}

.lasso-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.lasso-mode-btn {
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.lasso-mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lasso-mode-btn.active {
    background: rgba(0, 217, 255, 0.3);
    border-color: rgba(0, 217, 255, 0.5);
}

.lasso-selection {
    position: absolute;
    border: 2px dashed #848484;
    background: rgba(56, 56, 56, 0.1);
    cursor: move;
    z-index: 55;
    pointer-events: auto;
}

.lasso-selection::after {
    content: '↔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #00d9ff;
    pointer-events: none;
}

#lassoCanvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 54;
}

#lassoCanvas.active {
    pointer-events: auto;
}

#aiLassoOverlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 15;
}

/* Segmentation Loading Indicator */
.segmentation-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #00d9ff;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 10px;
}

.segmentation-loading.active {
    display: flex;
}

.segmentation-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 217, 255, 0.3);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Auto-segment toggle */
.lasso-auto-segment-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 6px;
}

.lasso-auto-segment-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00d9ff;
}

.lasso-auto-segment-toggle label {
    font-size: 12px;
    color: #fff;
    cursor: pointer;
}

/* Segment mode buttons */
.segment-mode-btns {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.segment-mode-btn {
    flex: 1;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.segment-mode-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.segment-mode-btn.active {
    background: rgba(0, 217, 255, 0.3);
    border-color: #00d9ff;
}

/* Segmenting state */
#lassoCanvas.segmenting {
    pointer-events: none;
    opacity: 0.5;
}

/* ============================================
   SKELETON LOADER STYLES
   Add these styles to your generate.css file
   ============================================ */

/* Base loading state */
.media-card.loading {
    pointer-events: none;
}

.media-card.loading .media-preview {
    background: linear-gradient(135deg, #0d0d10 0%, #12121a 100%);
}

/* Skeleton Loader Container */
.skeleton-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(
        135deg,
        rgba(15, 15, 20, 0.95) 0%,
        rgba(20, 20, 28, 0.95) 50%,
        rgba(15, 15, 20, 0.95) 100%
    );
    overflow: hidden;
}

/* Animated background shimmer */
.skeleton-loader::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 20%,
        rgba(255, 255, 255, 0.03) 40%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.03) 60%,
        transparent 80%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Spinner Ring */
.spinner-ring {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.spinner-ring::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.08);
}

.spinner-ring::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #b8ff4a;
    border-right-color: rgba(184, 255, 74, 0.3);
    animation: spin 1s cubic-bezier(0.68, -0.35, 0.32, 1.35) infinite;
    filter: drop-shadow(0 0 8px rgba(184, 255, 74, 0.4));
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Icon inside spinner */
.spinner-icon {
    position: relative;
    z-index: 2;
    width: 32px;
    height: 32px;
    color: #b8ff4a;
    opacity: 0.9;
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Loading text container */
.loading-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.loading-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
}

.loading-subtitle {
    font-size: 12px;
    color: #6b6b75;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Animated dots */
.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 4px;
    height: 4px;
    background: #b8ff4a;
    border-radius: 50%;
    animation: bounce-dot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce-dot {
    0%, 60%, 100% { 
        transform: translateY(0);
        opacity: 0.4;
    }
    30% { 
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Progress bar */
.loading-progress {
    width: 120px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #b8ff4a, #9dff00, #b8ff4a);
    background-size: 200% 100%;
    border-radius: 3px;
    animation: progress-shimmer 1.5s ease-in-out infinite;
    width: 60%;
}

@keyframes progress-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* VIDEO-SPECIFIC STYLING */
.skeleton-loader.video .spinner-ring::after {
    border-top-color: #b8ff4a;
    border-right-color: rgba(137, 255, 107, 0.3);
}

.skeleton-loader.video .spinner-icon {
    color: #b8ff4a;
}

.skeleton-loader.video .loading-dots span {
    background: #b8ff4a;
}

.skeleton-loader.video .loading-progress-bar {
    background: linear-gradient(90deg, #b8ff4a, #b6f15d, #b8ff4a);
    background-size: 200% 100%;
}

/* Orbital ring animation for video */
.orbital-ring {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    animation: orbit 3s linear infinite;
    z-index: 1;
}

.orbital-ring::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #b8ff4a;
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    filter: drop-shadow(0 0 6px #b8ff4a);
}

.skeleton-loader.video .orbital-ring::before {
    background: #b8ff4a;
    filter: drop-shadow(0 0 6px #b8ff4a);
}

@keyframes orbit {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status badge */
.status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: #b8ff4a;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.status-badge.video {
    color: #b8ff4a;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .spinner-ring {
        width: 60px;
        height: 60px;
    }
    
    .spinner-icon {
        width: 24px;
        height: 24px;
    }
    
    .orbital-ring {
        width: 70px;
        height: 70px;
    }
    
    .loading-title {
        font-size: 13px;
    }
    
    .loading-subtitle {
        font-size: 11px;
    }
    
    .loading-progress {
        width: 100px;
    }
    
    .status-badge {
        padding: 4px 10px;
        font-size: 10px;
    }
}

/* ============================================
   PROFESSIONAL AVATAR MODAL STYLES
   ============================================ */

.avatar-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999999;
  animation: fadeIn 0.3s ease;
}

.avatar-modal.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.avatar-modal-content {
  background: linear-gradient(145deg, #0f1113 0%, #1a1d1f 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.avatar-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-dim), transparent);
  border: 1px solid var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #c8ff00;
}

.header-text h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
  letter-spacing: -0.3px;
}

.header-text p {
  font-size: 13px;
  color: #7a8089;
  margin: 0;
}

.header-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #9aa2ac;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.header-close:hover {
  background: rgba(255, 60, 60, 0.15);
  border-color: rgba(255, 60, 60, 0.3);
  color: #ff4757;
  transform: rotate(90deg);
}

/* Upload Section */
.avatar-upload-section {
  padding: 20px 28px;
  background: rgba(0, 0, 0, 0.2);
}

.upload-area {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-area:hover {
  border-color: rgba(0, 85, 255, 0.4);
  background: rgba(0, 85, 255, 0.05);
  transform: translateY(-2px);
}

.upload-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #c8ff00;
  flex-shrink: 0;
}

.upload-area:hover .upload-icon {
  transform: scale(1.1);
  background: linear-gradient(135deg, rgba(0, 85, 255, 0.2), rgba(22, 121, 250, 0.2));
}

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upload-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
}

.upload-subtitle {
  font-size: 13px;
  color: #7a8089;
}

/* Section Divider */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  color: #5a6169;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
}

/* Avatar Grid Container */
.avatar-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 28px 20px 28px;
  min-height: 200px;
}

.avatar-grid-container::-webkit-scrollbar {
  width: 6px;
}

.avatar-grid-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  margin: 4px 0;
}

.avatar-grid-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.avatar-grid-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
}

.avatar-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.02);
}

.avatar-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 85, 255, 0.1),
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.avatar-cell:hover {
  border-color: rgba(0, 85, 255, 0.4);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 85, 255, 0.2);
}

.avatar-cell:hover::before {
  opacity: 1;
}

.avatar-cell.selected {
  border-color: #c8ff00;
}

.avatar-cell.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #c8ff00, var(--accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #171717;
  animation: checkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.avatar-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Footer Actions */
.avatar-modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: -0.2px;
}

.action-btn i {
  font-size: 16px;
}

.action-delete {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #9aa2ac;
}

.action-delete:hover {
  background: rgba(255, 60, 60, 0.15);
  border-color: rgba(255, 60, 60, 0.3);
  color: #ff4757;
  transform: translateY(-2px);
}

.action-primary {
  background: linear-gradient(135deg, #c8ff00, var(--accent2));
  color: #151515;
  border: none;
}

.action-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.action-primary:active,
.action-delete:active {
  transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 767px) {
  .avatar-modal-content {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
  }

  .avatar-modal-header {
    padding: 20px;
  }

  .header-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .header-text h3 {
    font-size: 16px;
  }

  .header-text p {
    font-size: 12px;
  }

  .avatar-upload-section {
    padding: 16px 20px;
  }

  .upload-area {
    padding: 16px;
  }

  .upload-icon {
    width: 46px;
    height: 46px;
    font-size: 22px;
  }

  .section-divider {
    padding: 12px 20px;
    font-size: 12px;
  }

  .avatar-grid-container {
    padding: 0 20px 16px 20px;
  }

  .avatar-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
  }

  .avatar-modal-footer {
    padding: 16px 20px;
    flex-direction: column;
  }

  .action-btn {
    padding: 12px 20px;
  }
}

/* Empty State */
.avatar-grid:empty::before {
  content: 'No avatars yet. Upload your first avatar above.';
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  padding: 40px 20px;
  color: #5a6169;
  font-size: 14px;
  text-align: center;
}