/* Homepage.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #0d0d1a;
  color: #e5e7eb;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== NAVBAR ========== */
.navbar {
  height: 80px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  border-bottom: 1px solid #ececf8;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1002;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6b5cff, #4338ff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.logo h2 {
  font-size: 22px;
  background: linear-gradient(135deg, #6b5cff, #4338ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-menu li a {
  text-decoration: none;
  color: #333;
  padding: 8px 14px;
  display: block;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: 0.3s;
}

.nav-menu li a:hover,
.nav-menu li.active a {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

/* CSS Only Hamburger */
.nav-toggle {
  display: none;
}

.hamburger {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #ececf8;
  background: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 1002;
  box-shadow: 0 8px 20px rgba(79, 70, 255, 0.08);
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: #4f46ff;
  border-radius: 20px;
  transition: all 0.3s ease;
}

/* ========== CONTAINER ========== */
.container {
  max-width: 1600px;
  margin: 0 auto;
  background: #12121f;
}

/* ========== HERO ========== */
.hero {
  text-align: center;
  padding: 40px 20px 24px;
  background: linear-gradient(180deg, #1a1a2e, #12121f);
  border-bottom: 1px solid #2a2a3e;
}

.hero h1 {
  max-width: 800px;
  margin: auto;
  font-size: 38px;
  font-weight: 800;
  color: #fff;
}

.hero h1 span {
  background: linear-gradient(135deg, #6b5cff, #4338ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  max-width: 650px;
  margin: 12px auto 0;
  color: #94a3b8;
  font-size: 17px;
  line-height: 1.6;
}

/* Download Options & Reset Canvas in Hero */
.hero-download-options {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 14px 28px;
  background: #1a1a2e;
  border-radius: 40px;
  border: 1px solid #2a2a3e;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-download-options label {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.hero-download-options select {
  background: #26263a;
  border: 1px solid #3a3a52;
  border-radius: 6px;
  color: #e5e7eb;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
}

.hero-download-options select:hover {
  border-color: #6c5aff;
}

.hero-download-options input[type="checkbox"] {
  accent-color: #6c5aff;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.how-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #3a3a52;
  background: #2a2a40;
  color: #cbd5e1;
  font-size: 13px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.how-btn:hover {
  background: #3d3d5c;
  color: #fff;
}

.how-btn.primary {
  background: linear-gradient(135deg, #6b5cff, #4338ff);
  border-color: #6c5aff;
  color: #fff;
}

.how-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 255, 0.3);
}

.download-hero-btn {
  padding: 8px 20px;
  border-radius: 20px;
}

/* ========== EDITOR LAYOUT ========== */
.editor-layout {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  background: #12121f;
  min-height: 550px;
  flex-wrap: wrap;
}

/* ========== LEFT PANEL ========== */
.left-panel {
  width: 210px;
  background: #1a1a2e;
  border-radius: 16px;
  padding: 14px 10px;
  flex-shrink: 0;
  border: 1px solid #2a2a3e;
  max-height: 620px;
  overflow-y: auto;
}

.left-panel .tool-section {
  margin-bottom: 4px;
}

.left-panel .tool-section .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin: 10px 0 4px 4px;
  font-weight: 600;
}

.left-panel .tool-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 7px 10px;
  border-radius: 8px;
  text-align: left;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: 0.15s;
  font-weight: 500;
}

.left-panel .tool-btn i {
  width: 18px;
  font-size: 13px;
  color: #7a7a9a;
}

.left-panel .tool-btn:hover {
  background: #2a2a40;
  color: #fff;
}

.left-panel .tool-btn.active {
  background: #2d2d50;
  color: #fff;
}

.left-panel .tool-btn.active i {
  color: #7c6aff;
}

.left-panel .divider {
  border-top: 1px solid #2a2a3e;
  margin: 4px 0;
}

.left-panel .upload-btn {
  background: #6c5aff;
  color: #fff;
  border-radius: 20px;
  justify-content: center;
  margin-top: 4px;
}

.left-panel .upload-btn i {
  color: #fff;
}

.left-panel .upload-btn:hover {
  background: #5a4ae0;
}

.left-panel .tool-btn.small {
  padding: 4px 10px;
  font-size: 11px;
  width: auto;
  display: inline-flex;
}

.size-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.size-controls input[type="number"] {
  width: 58px;
  background: #26263a;
  border: 1px solid #3a3a52;
  border-radius: 6px;
  color: #fff;
  padding: 4px 6px;
  font-size: 12px;
}

.size-controls span {
  color: #6b7280;
}

/* ========== PROPERTY ROWS ========== */
.prop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.prop-row label {
  font-size: 11px;
  min-width: 28px;
  color: #94a3b8;
}

.prop-row input[type="color"] {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.prop-row input[type="range"] {
  flex: 1;
  accent-color: #6c5aff;
  background: #2d2d42;
  height: 4px;
  border-radius: 4px;
  min-width: 60px;
}

.prop-row span {
  color: #94a3b8;
  font-size: 11px;
  min-width: 20px;
  text-align: center;
}

/* ========== UPSCALE OPTIONS ========== */
.upscale-options {
  display: none;
  gap: 4px;
  padding: 4px 0;
  flex-wrap: wrap;
}

.upscale-options.active {
  display: flex;
}

.upscale-option {
  flex: 1;
  min-width: 40px;
  padding: 4px 8px;
  border: 1px solid #3a3a52;
  border-radius: 6px;
  background: #26263a;
  color: #cbd5e1;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  transition: 0.2s;
}

.upscale-option:hover {
  background: #3a3a5c;
  border-color: #6c5aff;
}

.upscale-option.cancel {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.upscale-option.cancel:hover {
  background: #3a1a1a;
}

/* ========== CANVAS WRAPPER ========== */
.canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  position: relative;
  min-width: 280px;
}

.canvas-container {
  background: #0f0f1a;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  padding: 8px;
  border: 1px solid #2a2a3e;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#editCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 800/500;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: default;
  max-width: 100%;
}

.canvas-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 4px 12px;
  background: #1a1a2e;
  border-radius: 30px;
  border: 1px solid #2a2a3e;
  flex-wrap: wrap;
}

.canvas-controls button {
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 13px;
}

.canvas-controls button:hover {
  background: #2a2a40;
}

.canvas-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.canvas-controls span {
  color: #94a3b8;
  font-size: 13px;
  min-width: 45px;
  text-align: center;
}

/* ========== RIGHT PANEL ========== */
.right-panel {
  width: 230px;
  background: #1a1a2e;
  border-radius: 16px;
  padding: 14px 12px;
  flex-shrink: 0;
  border: 1px solid #2a2a3e;
  max-height: 620px;
  overflow-y: auto;
}

.right-panel .prop-group {
  border-bottom: 1px solid #28283a;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.right-panel .prop-group:last-child {
  border-bottom: none;
}

.right-panel .prop-group .prop-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7280;
  margin-bottom: 8px;
  font-weight: 600;
}

.right-panel .prop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.right-panel .prop-row input[type="number"] {
  width: 46px;
  background: #26263a;
  border: 1px solid #3a3a52;
  border-radius: 6px;
  color: #fff;
  padding: 3px 4px;
  font-size: 11px;
}

.right-panel .prop-row select {
  background: #26263a;
  border: 1px solid #3a3a52;
  border-radius: 6px;
  color: #e5e7eb;
  padding: 3px 5px;
  font-size: 11px;
  flex: 1;
  min-width: 60px;
}

.right-panel .action-btn {
  background: #2d2d42;
  border: none;
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: 0.2s;
}

.right-panel .action-btn:hover {
  background: #3d3d5c;
}

/* ========== LAYERS ========== */
.right-panel .layer-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 110px;
  overflow-y: auto;
  min-height: 50px;
}

.right-panel .layer-item {
  background: #22223a;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  border: 1px solid transparent;
  transition: 0.2s;
  user-select: none;
}

.right-panel .layer-item:hover {
  background: #2a2a4a;
}

.right-panel .layer-item.active {
  border-color: #6c5aff;
  background: #2a2a4a;
}

.right-panel .layer-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.right-panel .layer-item.drag-over {
  border-color: #6c5aff;
  background: #2a2a4a;
}

.right-panel .layer-item .drag-handle {
  cursor: grab;
  color: #5a5a7a;
  margin-left: 6px;
}

/* ========== SHAPES MODAL ========== */
.shapes-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
}

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

.shapes-modal-content {
  background: #1a1a2e;
  border-radius: 20px;
  padding: 24px;
  max-width: 680px;
  width: 92%;
  max-height: 80vh;
  border: 1px solid #2a2a3e;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  overflow-y: auto;
}

.shapes-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid #2a2a3e;
  padding-bottom: 12px;
}

.shapes-modal-header h3 {
  font-size: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-modal {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.close-modal:hover {
  background: #2a2a40;
  color: #fff;
}

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

.shape-item {
  background: #22223a;
  border: 2px solid #2a2a3e;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #6c5aff;
}

.shape-item:hover {
  border-color: #6c5aff;
  background: #2a2a4a;
  transform: translateY(-3px);
}

.shape-item svg {
  width: 42px;
  height: 42px;
}

.shape-item .shape-name {
  font-size: 10px;
  color: #94a3b8;
  text-transform: capitalize;
}

/* ========== FEATURES ========== */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 30px 20px;
  background: #1a1a2e;
}

.feature {
  background: #22223a;
  padding: 20px 16px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid #2a2a3e;
  transition: 0.3s;
}

.feature:hover {
  transform: translateY(-4px);
  border-color: #6c5aff;
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon i {
  font-size: 20px;
}

.blue {
  background: #1a2a4a;
  color: #60a5fa;
}

.purple {
  background: #2a1a4a;
  color: #a78bfa;
}

.green {
  background: #1a3a2a;
  color: #34d399;
}

.orange {
  background: #3a2a1a;
  color: #fb923c;
}

.feature h4 {
  font-size: 16px;
  color: #fff;
  margin-bottom: 4px;
}

.feature p {
  color: #94a3b8;
  font-size: 13px;
}

/* ========== FOOTER ========== */
.footer {
  text-align: center;
  padding: 16px;
  color: #64748b;
  font-size: 13px;
  border-top: 1px solid #2a2a3e;
  background: #1a1a2e;
}

.footer-tagline {
  font-size: 11px;
  opacity: 0.6;
}

/* ========== NOTIFICATION ========== */
.notification-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a1a2e;
  color: #e5e7eb;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid #2a2a3e;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 99999;
  font-size: 13px;
  max-width: 400px;
  transition: 0.3s;
}

/* ========== EXTRA CONTROLS ========== */
.right-panel .prop-row input[type="range"] {
  min-width: 60px;
  flex: 1;
}

.right-panel .prop-row span {
  min-width: 30px;
  text-align: right;
}

.crop-helper-note {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ========== FABRIC CANVAS FIX ========== */
.canvas-container>.canvas-container {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 auto !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  display: block !important;
}

.canvas-container>.canvas-container canvas {
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 12px !important;
  display: block !important;
}

/* ========== SCROLLBARS ========== */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar,
.shapes-modal-content::-webkit-scrollbar,
.layer-list::-webkit-scrollbar {
  width: 6px;
}

.left-panel::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track,
.shapes-modal-content::-webkit-scrollbar-track,
.layer-list::-webkit-scrollbar-track {
  background: #151526;
  border-radius: 10px;
}

.left-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb,
.shapes-modal-content::-webkit-scrollbar-thumb,
.layer-list::-webkit-scrollbar-thumb {
  background: #3a3a52;
  border-radius: 10px;
}

.left-panel::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover,
.shapes-modal-content::-webkit-scrollbar-thumb:hover,
.layer-list::-webkit-scrollbar-thumb:hover {
  background: #6c5aff;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
  .navbar {
    padding: 0 24px;
  }

  .nav-menu {
    gap: 8px;
  }

  .nav-menu li a {
    padding: 8px 10px;
    font-size: 13px;
  }
}

@media (max-width: 1024px) {
  .editor-layout {
    flex-direction: column;
  }

  .left-panel {
    width: 100%;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .left-panel .tool-section {
    flex: 1;
    min-width: 130px;
  }

  .right-panel {
    width: 100%;
    max-height: none;
  }

  .canvas-wrapper {
    padding: 8px 0;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: 76px;
    padding: 0 16px;
    flex-direction: row;
  }

  .logo h2 {
    font-size: 20px;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
    font-size: 21px;
  }

  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 76px;
    left: 0;
    width: 100%;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    padding: 0 16px;
    border-bottom: 1px solid #ececf8;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
    transition: all 0.35s ease;
  }

  .nav-toggle:checked ~ .nav-menu {
    max-height: 80vh;
    visibility: visible;
    opacity: 1;
    padding: 16px 16px 20px;
  }

  .nav-menu li a {
    text-align: center;
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 12px;
  }

  .nav-toggle:checked + .hamburger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .nav-toggle:checked + .hamburger span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked + .hamburger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .hero h1 {
    font-size: 26px;
  }

  .hero-download-options {
    padding: 10px 16px;
    gap: 8px;
    max-width: 100%;
    border-radius: 20px;
  }

  .features {
    grid-template-columns: 1fr 1fr;
  }

  .shapes-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }
}

@media (max-width: 480px) {
  .features {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 20px;
  }

  .right-panel .prop-row {
    flex-wrap: wrap;
  }

  .hero-download-options {
    flex-wrap: wrap;
    padding: 8px 12px;
  }

  .hero-download-options label {
    font-size: 12px;
  }
}