/* ═══════════════════════════════════════════════════════════════════════════
   VISUDEN CROP IMAGE - ADVANCED IMAGE CROPPING TOOL
   A professional-grade image cropping interface with multiple modes
   ═══════════════════════════════════════════════════════════════════════════ */

   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #fff;
    background: #050508;
    min-height: 100vh;
    overflow-x: hidden;
  }
  
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
      radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
      radial-gradient(ellipse 60% 40% at 100% 100%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
      linear-gradient(180deg, #050508 0%, #0a0f14 100%);
    z-index: -1;
  }
  
  .hero {
    display: none !important;
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     HERO SECTION
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .crop-hero {
    min-height: 100vh;
    padding: 100px 5% 60px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }
  
  .container {
    max-width: 1600px;
    width: 100%;
  }
  
  .gradient-text-emerald {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .hero-title {
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-align: center;
    letter-spacing: -0.02em;
  }
  
  .hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    line-height: 1.6;
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     DROP ZONE
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .drop-zone {
    border: 2px dashed rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    padding: 4rem 2rem;
    background: rgba(16, 185, 129, 0.03);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
  }
  
  .drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
  }
  
  .drop-zone:hover {
    border-color: rgba(16, 185, 129, 0.6);
    transform: translateY(-2px);
  }
  
  .drop-zone:hover::before {
    opacity: 1;
  }
  
  .drop-zone.dragover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    transform: scale(1.01);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.2);
  }
  
  .drop-text {
    position: relative;
    z-index: 1;
    text-align: center;
  }
  
  .drop-text svg {
    color: #10b981;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.3));
  }
  
  .drop-text p {
    font-size: 1.35rem;
    margin: 1rem 0;
    color: rgba(255,255,255,0.8);
  }
  
  .browse-link {
    color: #10b981;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
  }
  
  .browse-link:hover {
    border-bottom-color: #10b981;
  }
  
  #file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
  }
  
  .drop-text small {
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
    display: block;
    margin-top: 1rem;
  }
  
  .hidden {
    display: none !important;
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     EDITOR CONTAINER
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .editor-container {
    background: rgba(255,255,255,0.02);
    border-radius: 24px;
    border: 1px solid rgba(16, 185, 129, 0.15);
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 
      0 4px 24px rgba(0,0,0,0.3),
      inset 0 1px 0 rgba(255,255,255,0.05);
    animation: editorSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes editorSlideIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     TOOLBAR
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    align-items: center;
  }
  
  .toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .toolbar-section.modes {
    flex: 1;
    min-width: 300px;
  }
  
  .toolbar-section.ratios {
    flex: 1;
    min-width: 280px;
  }
  
  .toolbar-section.actions {
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
  }
  
  .toolbar-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
  }
  
  .mode-buttons,
  .ratio-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  
  .mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
  }
  
  .mode-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  
  .mode-btn span {
    white-space: nowrap;
  }
  
  .mode-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #fff;
  }
  
  .mode-btn.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.25));
    border-color: #10b981;
    color: #fff;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
  }
  
  .mode-btn.smart {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border-color: rgba(139, 92, 246, 0.3);
  }
  
  .mode-btn.smart:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    border-color: rgba(139, 92, 246, 0.5);
  }
  
  .mode-btn.smart.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
    border-color: #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
  }
  
  .ai-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.35rem;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  
  .ratio-btn {
    padding: 0.45rem 0.85rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
  }
  
  .ratio-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #fff;
  }
  
  .ratio-btn.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
  }
  
  .custom-ratio-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    animation: fadeIn 0.3s ease;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .ratio-input {
    width: 60px;
    padding: 0.4rem 0.6rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
  }
  
  .ratio-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  }
  
  .apply-btn {
    padding: 0.4rem 0.8rem;
    background: #10b981;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
  }
  
  .apply-btn:hover {
    background: #059669;
    transform: translateY(-1px);
  }
  
  .action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.25s ease;
  }
  
  .action-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #fff;
    transform: translateY(-2px);
  }
  
  .action-btn:active {
    transform: translateY(0);
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     CANVAS AREA
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .canvas-wrapper {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(0,0,0,0.2);
    min-height: 500px;
  }
  
  .canvas-container {
    flex: 1;
    position: relative;
    background: 
      linear-gradient(45deg, #1a1a1f 25%, transparent 25%),
      linear-gradient(-45deg, #1a1a1f 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, #1a1a1f 75%),
      linear-gradient(-45deg, transparent 75%, #1a1a1f 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #141418;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
  }
  
  #crop-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
  }
  
  #overlay-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
  }
  
  /* Crop Handles */
  .crop-handles {
    position: absolute;
    pointer-events: none;
    z-index: 20;
  }
  
  .handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid #10b981;
    border-radius: 2px;
    pointer-events: all;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  
  .handle:hover {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
  }
  
  .handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
  .handle.n { top: -6px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
  .handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
  .handle.e { top: 50%; right: -6px; transform: translateY(-50%); cursor: e-resize; }
  .handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
  .handle.s { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
  .handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
  .handle.w { top: 50%; left: -6px; transform: translateY(-50%); cursor: w-resize; }
  
  .handle.n:hover, .handle.s:hover { transform: translateX(-50%) scale(1.3); }
  .handle.e:hover, .handle.w:hover { transform: translateY(-50%) scale(1.3); }
  
  /* Grid Overlay */
  .grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
    background: 
      linear-gradient(to right, rgba(255,255,255,0.1) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 33.333% 33.333%;
  }
  
  .grid-overlay.rule-of-thirds {
    background: none;
  }
  
  .grid-overlay.rule-of-thirds::before,
  .grid-overlay.rule-of-thirds::after {
    content: '';
    position: absolute;
    background: rgba(255,255,255,0.3);
  }
  
  .grid-overlay.rule-of-thirds::before {
    left: 33.333%;
    right: 33.333%;
    top: 0;
    bottom: 0;
    border-left: 1px solid rgba(255,255,255,0.2);
    border-right: 1px solid rgba(255,255,255,0.2);
  }
  
  .grid-overlay.rule-of-thirds::after {
    top: 33.333%;
    bottom: 33.333%;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }
  
  /* Size Tooltip */
  .size-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 0.4rem 0.8rem;
    background: rgba(0,0,0,0.85);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 30;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
  }
  
  /* Instructions Overlay */
  .instructions-overlay {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.6rem 1.2rem;
    background: rgba(16, 185, 129, 0.9);
    border-radius: 8px;
    z-index: 25;
    backdrop-filter: blur(10px);
    animation: pulseGlow 2s ease infinite;
  }
  
  @keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  }
  
  .instructions-overlay p {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    margin: 0;
  }
  
  /* Zoom Controls */
  .zoom-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem;
    background: rgba(0,0,0,0.7);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 30;
  }
  
  .zoom-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 6px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .zoom-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    color: #fff;
  }
  
  #zoom-level {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    min-width: 45px;
    text-align: center;
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     PREVIEW PANEL
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .preview-panel {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.05);
  }
  
  .preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .preview-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
  }
  
  .toggle-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .toggle-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
  }
  
  .toggle-btn.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
  }
  
  .preview-canvas-container {
    position: relative;
    aspect-ratio: 1;
    background: 
      linear-gradient(45deg, #1a1a1f 25%, transparent 25%),
      linear-gradient(-45deg, #1a1a1f 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, #1a1a1f 75%),
      linear-gradient(-45deg, transparent 75%, #1a1a1f 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    background-color: #141418;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #preview-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
  }
  
  .preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.3);
    text-align: center;
    padding: 1rem;
  }
  
  .preview-placeholder svg {
    opacity: 0.5;
  }
  
  .preview-placeholder p {
    font-size: 0.85rem;
  }
  
  .preview-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
  }
  
  .info-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
  }
  
  .info-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    font-feature-settings: 'tnum';
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     BOTTOM ACTIONS - STICKY DOWNLOAD BAR
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .bottom-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.85) 100%);
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    position: sticky;
    bottom: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
  }
  
  .export-options {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
  }
  
  .format-selector {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }
  
  .format-selector label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
  }
  
  .format-selector select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
  }
  
  .format-selector select:focus {
    outline: none;
    border-color: #10b981;
  }
  
  .quality-slider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .quality-slider label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
  }
  
  .quality-slider label span {
    color: #10b981;
    font-weight: 600;
  }
  
  .quality-slider input[type="range"] {
    width: 100px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    appearance: none;
    cursor: pointer;
  }
  
  .quality-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: #10b981;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    transition: transform 0.2s ease;
  }
  
  .quality-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
  }
  
  .action-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
  }
  
  .action-btn-large svg {
    width: 20px;
    height: 20px;
  }
  
  .action-btn-large.primary {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    color: white;
    box-shadow: 
      0 4px 20px rgba(16, 185, 129, 0.5),
      0 0 40px rgba(16, 185, 129, 0.3),
      inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    min-width: 200px;
    justify-content: center;
  }
  
  .action-btn-large.primary::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #10b981, #06b6d4, #10b981);
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(8px);
    animation: pulseGlowBtn 2s ease-in-out infinite;
  }
  
  @keyframes pulseGlowBtn {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
  }
  
  .action-btn-large.primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
  }
  
  .action-btn-large.primary:hover::after {
    left: 100%;
  }
  
  .action-btn-large.primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
      0 8px 35px rgba(16, 185, 129, 0.6),
      0 0 60px rgba(16, 185, 129, 0.4),
      inset 0 1px 0 rgba(255,255,255,0.3);
  }
  
  .action-btn-large.primary:active {
    transform: translateY(-1px) scale(1.01);
  }
  
  .action-btn-large.primary .arrow-icon {
    transition: transform 0.3s ease;
    margin-left: 0.25rem;
  }
  
  .action-btn-large.primary:hover .arrow-icon {
    transform: translateX(4px);
  }
  
  /* Download button pulse animation when selection is made */
  .action-btn-large.primary.has-selection {
    animation: downloadPulse 2s ease-in-out infinite;
  }
  
  @keyframes downloadPulse {
    0%, 100% { 
      box-shadow: 
        0 4px 20px rgba(16, 185, 129, 0.5),
        0 0 40px rgba(16, 185, 129, 0.3);
    }
    50% { 
      box-shadow: 
        0 4px 30px rgba(16, 185, 129, 0.7),
        0 0 60px rgba(16, 185, 129, 0.5);
    }
  }
  
  /* Floating download button indicator */
  .floating-download-hint {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    animation: bounceIn 0.5s ease, floatUpDown 2s ease-in-out infinite 0.5s;
    cursor: pointer;
    transition: transform 0.3s ease;
  }
  
  .floating-download-hint:hover {
    transform: scale(1.05);
  }
  
  .floating-download-hint svg {
    animation: bounceArrow 1s ease infinite;
  }
  
  @keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
  }
  
  @keyframes floatUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
  }
  
  @keyframes bounceArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
  }
  
  @keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
  }
  
  .action-btn-large.secondary {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.15);
  }
  
  .action-btn-large.secondary:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     SUCCESS ACTIONS
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .success-actions {
    margin: 3rem auto;
    max-width: 800px;
    padding: 2.5rem;
    background: rgba(255,255,255,0.03);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(16, 185, 129, 0.2);
    animation: successSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes successSlideIn {
    from {
      opacity: 0;
      transform: translateY(30px) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
  
  .success-message {
    text-align: center;
    margin-bottom: 2rem;
  }
  
  .success-message svg {
    color: #10b981;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 20px rgba(16, 185, 129, 0.4));
    animation: successBounce 0.6s ease 0.3s;
  }
  
  @keyframes successBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
  }
  
  .success-message h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .success-message p {
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
  }
  
  .action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
  }
  
  .action-btn {
    padding: 1rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    font-family: inherit;
  }
  
  .action-btn svg {
    transition: transform 0.3s ease;
  }
  
  .action-btn.primary {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    color: white;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
  }
  
  .action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
  }
  
  .action-btn.primary:hover svg {
    transform: translateY(2px);
  }
  
  .action-btn.secondary {
    background: rgba(255,255,255,0.08);
    color: white;
    border: 2px solid rgba(16, 185, 129, 0.25);
  }
  
  .action-btn.secondary:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     SOCIAL SHARING
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .social-sharing {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(16, 185, 129, 0.15);
  }
  
  .share-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .social-buttons {
    display: flex;
    gap: 0.85rem;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .social-btn {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
  }
  
  .social-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .social-btn:hover {
    transform: translateY(-4px) scale(1.05);
  }
  
  .social-btn:active {
    transform: translateY(-2px) scale(1.02);
  }
  
  .social-btn.facebook { color: #1877f2; }
  .social-btn.facebook::before { background: #1877f2; box-shadow: 0 8px 25px rgba(24, 119, 242, 0.4); }
  .social-btn.facebook:hover::before { opacity: 0.15; }
  
  .social-btn.twitter { color: #1da1f2; }
  .social-btn.twitter::before { background: #1da1f2; box-shadow: 0 8px 25px rgba(29, 161, 242, 0.4); }
  .social-btn.twitter:hover::before { opacity: 0.15; }
  
  .social-btn.linkedin { color: #0a66c2; }
  .social-btn.linkedin::before { background: #0a66c2; box-shadow: 0 8px 25px rgba(10, 102, 194, 0.4); }
  .social-btn.linkedin:hover::before { opacity: 0.15; }
  
  .social-btn.whatsapp { color: #25d366; }
  .social-btn.whatsapp::before { background: #25d366; box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4); }
  .social-btn.whatsapp:hover::before { opacity: 0.15; }
  
  .social-btn.reddit { color: #ff4500; }
  .social-btn.reddit::before { background: #ff4500; box-shadow: 0 8px 25px rgba(255, 69, 0, 0.4); }
  .social-btn.reddit:hover::before { opacity: 0.15; }
  
  .social-btn svg {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     RECOMMENDED SERVICES
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .recommended-services {
    margin: 4rem auto;
    max-width: 1200px;
    animation: fadeInUp 0.6s ease;
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .recommendations-title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .services-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
  }
  
  .service-card-compact {
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 1.75rem;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    border: 1px solid rgba(16, 185, 129, 0.15);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
  }
  
  .service-card-compact::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.08));
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .service-card-compact:hover::before {
    opacity: 1;
  }
  
  .service-card-compact:hover {
    transform: translateY(-6px);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.2);
  }
  
  .service-icon-compact {
    font-size: 2.75rem;
    margin-bottom: 0.85rem;
    filter: drop-shadow(0 3px 6px rgba(16, 185, 129, 0.25));
    transition: transform 0.3s ease;
  }
  
  .service-card-compact:hover .service-icon-compact {
    transform: scale(1.1) rotate(3deg);
  }
  
  .service-title-compact {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    position: relative;
    z-index: 1;
  }
  
  .service-description-compact {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    position: relative;
    z-index: 1;
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     RESPONSIVE DESIGN
     ═══════════════════════════════════════════════════════════════════════════ */
  
  @media (max-width: 1024px) {
    .canvas-wrapper {
      flex-direction: column;
    }
    
    .preview-panel {
      width: 100%;
      flex-direction: row;
      flex-wrap: wrap;
      gap: 1rem;
    }
    
    .preview-header {
      width: 100%;
    }
    
    .preview-canvas-container {
      flex: 1;
      min-width: 200px;
      aspect-ratio: auto;
      min-height: 200px;
    }
    
    .preview-info {
      flex: 1;
      min-width: 200px;
    }
  }
  
  @media (max-width: 768px) {
    .crop-hero {
      padding: 90px 4% 40px;
    }
    
    .toolbar {
      flex-direction: column;
      gap: 1rem;
    }
    
    .toolbar-section {
      width: 100%;
    }
    
    .toolbar-section.actions {
      justify-content: center;
      flex-wrap: wrap;
    }
    
    .mode-btn span {
      display: none;
    }
    
    .mode-btn {
      padding: 0.6rem;
    }
    
    .bottom-actions {
      flex-direction: column;
      gap: 1rem;
      padding: 1rem;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      border-radius: 20px 20px 0 0;
    }
    
    .export-options {
      width: 100%;
      justify-content: center;
    }
    
    .action-btn-large {
      width: 100%;
      justify-content: center;
    }
    
    .action-btn-large.primary {
      order: -1;
      padding: 1.2rem 2rem;
      font-size: 1.15rem;
    }
    
    .drop-zone {
      padding: 3rem 1.5rem;
    }
    
    .hero-title {
      font-size: 1.8rem;
    }
    
    .hero-subtitle {
      font-size: 1rem;
    }
    
    .action-buttons {
      flex-direction: column;
    }
    
    .action-btn {
      width: 100%;
      justify-content: center;
    }
    
    .success-actions {
      padding: 1.75rem;
    }
    
    .services-grid-compact {
      grid-template-columns: 1fr;
    }
  }
  
  @media (max-width: 480px) {
    .hero-title {
      font-size: 1.6rem;
    }
    
    .recommendations-title {
      font-size: 1.4rem;
    }
    
    .ratio-buttons {
      justify-content: center;
    }
    
    .social-btn {
      width: 46px;
      height: 46px;
    }
    
    .social-btn svg {
      width: 20px;
      height: 20px;
    }
    
    .canvas-container {
      min-height: 300px;
    }
    
    .zoom-controls {
      bottom: 0.5rem;
      right: 0.5rem;
      padding: 0.3rem;
    }
    
    .zoom-btn {
      width: 28px;
      height: 28px;
    }
    
    #zoom-level {
      font-size: 0.75rem;
      min-width: 40px;
    }
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     CURSOR STYLES FOR DIFFERENT MODES
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .canvas-container[data-mode="rectangle"] {
    cursor: crosshair;
  }
  
  .canvas-container[data-mode="freehand"] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2'%3E%3Cpath d='M12 19l7-7 3 3-7 7-3-3z'/%3E%3Cpath d='M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z'/%3E%3C/svg%3E") 0 24, auto;
  }
  
  .canvas-container[data-mode="circle"] {
    cursor: crosshair;
  }
  
  .canvas-container[data-mode="polygon"] {
    cursor: crosshair;
  }
  
  .canvas-container[data-mode="smart"] {
    cursor: wait;
  }
  
  .canvas-container.drawing {
    cursor: none;
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     LOADING STATES
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 100;
    backdrop-filter: blur(5px);
  }
  
  .loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  .loading-text {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    font-weight: 500;
  }
  
  /* ═══════════════════════════════════════════════════════════════════════════
     FREEHAND PATH VISUALIZATION
     ═══════════════════════════════════════════════════════════════════════════ */
  
  .freehand-path {
    fill: none;
    stroke: #10b981;
    stroke-width: 2;
    stroke-dasharray: 8 4;
    animation: dashMove 0.5s linear infinite;
  }
  
  @keyframes dashMove {
    to { stroke-dashoffset: -12; }
  }
  
  .polygon-point {
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 25;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.15s ease;
  }
  
  .polygon-point:hover {
    transform: translate(-50%, -50%) scale(1.3);
  }
  
  .polygon-point.first {
    background: #f59e0b;
  }