/* Custom styles for the image editor */
/* styles.css */
/* Base Styles */
:root {
    --bg-dark: #1a202c;
    --bg-darker: #111827;
    --border-dark: #374151;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --accent-red: #ef4444;
    --accent-red-hover: #dc2626;
    --accent-orange: #f97316;
    --accent-orange-hover: #ea580c;
    --accent-pink: #ec4899;
    --accent-pink-hover: #db2777;
    --accent-teal: #14b8a6;
    --accent-teal-hover: #0d9488;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    height: 100%;
  }
  
  /* Header Styles */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: 40px;
    margin-right: 8px;
    background: #ffffff;
    border-radius: 100%;
    padding: 2px;
}

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
  }
  
  /* Utility Classes */
  .flex {
    display: flex;
  }
  
  .flex-col {
    flex-direction: column;
  }
  
  .items-center {
    align-items: center;
  }
  
  .justify-between {
    justify-content: space-between;
  }
  
  .justify-center {
    justify-content: center;
  }
  
  .gap-2 {
    gap: 0.5rem;
  }
  
  .gap-3 {
    gap: 0.75rem;
  }
  
  .gap-4 {
    gap: 1rem;
  }
  
  .gap-6 {
    gap: 1.5rem;
  }
  
  .hidden {
    display: none;
  }
  
  /* Layout Components */
  .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
  }
  
  /* Header */
  header {
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-dark);
    padding: 1rem;
  }
  
  header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
  }
  
  /* Main Content */
  .main-content {
    padding: 1rem;
  }
  
  /* File Upload Section */
  .upload-section {
    background-color: var(--bg-darker);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  .upload-section h4{
    font-size: 14px;
    font-weight: 100;
    color: #d0d0d0;
  }
  
  .upload-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  @media (min-width: 640px) {
    .upload-row {
      flex-direction: row;
    }
  }
  
  .upload-label {
    background-color: var(--accent-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
  }
  
  .upload-label:hover {
    background-color: var(--accent-blue-hover);
  }
  
  .file-input {
    display: none;
  }
  
  .action-buttons {
    display: flex;
    gap: 0.5rem;
  }
  
  .btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    color: white;
    cursor: pointer;
  }
  
  .btn-gray {
    background-color: var(--gray-700);
  }
  
  .btn-gray:hover {
    background-color: var(--gray-600);
  }
  
  .btn-blue {
    background-color: var(--accent-blue);
  }
  
  .btn-blue:hover {
    background-color: var(--accent-blue-hover);
  }
  
  .btn-green {
    background-color: var(--accent-green);
  }
  
  .btn-green:hover {
    background-color: var(--accent-green-hover);
  }
  
  .btn-red {
    background-color: var(--accent-red);
  }
  
  .btn-red:hover {
    background-color: var(--accent-red-hover);
  }
  
  .btn-orange {
    background-color: var(--accent-orange);
  }
  
  .btn-orange:hover {
    background-color: var(--accent-orange-hover);
  }
  
  .btn-pink {
    background-color: var(--accent-pink);
  }
  
  .btn-pink:hover {
    background-color: var(--accent-pink-hover);
  }
  
  .btn-teal {
    background-color: var(--accent-teal);
  }
  
  .btn-teal:hover {
    background-color: var(--accent-teal-hover);
  }
  
  /* Editor Layout */
  .editor-layout {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 200px);
    flex-direction: column;
  }
  
  @media (min-width: 1024px) {
    .editor-layout {
      flex-direction: row;
    }
  }
  
  /* Tools Panel */
  .tools-panel {
    width: 100%;
    background-color: var(--bg-darker);
    border-radius: 0.5rem;
    padding: 1rem;
    height: 100%;
    overflow-y: auto;
  }
  
  @media (min-width: 1024px) {
    .tools-panel {
      width: 20rem;
      flex-shrink: 0;
    }
  }
  
  .tools-panel h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .tool-section {
    margin-bottom: 1.5rem;
  }
  
  .tool-section h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .tool-control {
    margin-bottom: 0.75rem;
  }
  
  .tool-control label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .tool-control input[type="range"] {
    width: 100%;
    height: 0.5rem;
    -webkit-appearance: none;
    background: var(--gray-700);
    border-radius: 0.25rem;
    outline: none;
  }
  
  .tool-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
  }
  
  .tool-control input[type="color"] {
    width: 100%;
    height: 2.5rem;
    border-radius: 0.25rem;
    border: none;
    padding: 0;
    cursor: pointer;
  }
  .tool-control select{
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: var(--gray-700);
    border: 1px solid var(--border-dark);
    border-radius: 0.25rem;
    color: white;
    outline: none;
  }
  .filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .filter-btn {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--gray-700);
    border: none;
    color: white;
    cursor: pointer;
  }
  
  .filter-btn:hover {
    background-color: var(--gray-600);
  }
  
  /* Canvas Area */
  .canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .canvas-container {
    background-color: var(--bg-darker);
    border-radius: 0.5rem;
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
  }
  
  .canvas-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .canvas-actions {
    display: flex;
    gap: 0.5rem;
  }
  
  .canvas-actions button {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    background-color: var(--gray-700);
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
  }
  
  .canvas-actions button:hover {
    background-color: var(--gray-600);
  }
  
  .canvas-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
    background-color: var(--gray-700);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #mainCanvas {
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
  }
  
  #placeholder {
    position: absolute;
    text-align: center;
    color: var(--text-secondary);
  }
  
  #placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
  }
  
  #placeholder p:first-of-type {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }
  
  #placeholder p:last-of-type {
    font-size: 0.875rem;
  }
  
  /* Loading Overlay */
  .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
  }
  
  .loading-content {
    background-color: var(--bg-darker);
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
  }
  
  .loading-spinner {
    animation: spin 1s linear infinite;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    border: 2px solid transparent;
    border-top-color: var(--accent-blue);
    margin: 0 auto 1rem;
  }
  
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  
  /* Form Elements */
  .text-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: var(--gray-700);
    border: 1px solid var(--border-dark);
    border-radius: 0.25rem;
    color: white;
    outline: none;
  }
  
  .text-input:focus {
    border-color: var(--accent-blue);
  }
  
  /* Full-width buttons */
  .btn-full {
    width: 100%;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
  }
  
/* Range slider styling */
input[type="range"] {
    appearance: none;
    height: 4px;
    background: #374151;
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* Active filter button */
.filter-btn.active {
    background: #3b82f6 !important;
    color: white;
}

/* Canvas container styling */
#canvasContainer {
    position: relative;
    overflow: hidden;
    background: 
        linear-gradient(45deg, #374151 25%, transparent 25%),
        linear-gradient(-45deg, #374151 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #374151 75%),
        linear-gradient(-45deg, transparent 75%, #374151 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Canvas cursor states */
.canvas-drawing { cursor: crosshair !important; }
.canvas-dragging { cursor: grabbing !important; }

/* Smooth transitions */
.transition-transform {
    transition: transform 0.2s ease;
}

/* Button hover animations */
button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Custom scrollbar for tools panel */
.tool-panel::-webkit-scrollbar {
    width: 6px;
}

.tool-panel::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 3px;
}

.tool-panel::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.tool-panel::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Text tool styles */
.text-overlay {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 5;
}

.text-overlay.active {
    outline: 2px dashed #007bff;
}

.text-overlay .text-content {
    padding: 2px;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    overflow: hidden;
}

/* Drawing cursor */
.drawing-cursor {
    cursor: crosshair;
}
.hr-line{
    margin: 20px 0;
    border: dashed 1px #444444;
}
/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Zoom controls */
.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* Image quality indicator */
.quality-indicator {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
}

/* Text element styling */
.text-element {
    position: absolute;
    cursor: move;
    user-select: none;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .container {
        padding: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .sticky {
        position: relative;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0.5rem;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .flex-col {
        flex-direction: column;
    }
    
    .sm\:flex-row {
        flex-direction: column;
    }
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}
.flex-space-between{
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Ensure loading overlay is initially hidden */
#loadingOverlay {
    display: none;
  }
  
  /* When 'hidden' class is added, it should be hidden */
  #loadingOverlay.hidden {
    display: none;
  }
  
  /* When active (no 'hidden' class) it should show */
  #loadingOverlay:not(.hidden) {
    display: flex;
  }
  /* Mobile-specific adjustments */
@media (max-width: 1023px) {
    .editor-layout {
      height: auto;
      flex-direction: column-reverse; /* Tools panel below canvas */
    }
  
    .tools-panel {
      width: 100%;
      max-height: 40vh; /* Limit tools panel height */
      overflow-y: auto; /* Make it scrollable if content is long */
      margin-top: 1rem;
    }
  
    .canvas-wrapper {
      min-height: 50vh; /* Give more space to canvas */
    }
  
    #mainCanvas {
      max-height: 50vh; /* Larger canvas display */
      width: auto !important;
    }
  
    .upload-row {
      flex-direction: column;
      gap: 1rem;
    }
  
    .action-buttons {
      justify-content: center;
      flex-wrap: wrap;
    }
  }
  
  /* Additional mobile tweaks for very small screens */
  @media (max-width: 480px) {
    .tools-panel {
      max-height: 35vh;
    }
  
    .canvas-wrapper {
      min-height: 55vh;
    }
  
    #mainCanvas {
      max-height: 55vh;
    }
  
    .filter-grid {
      grid-template-columns: repeat(3, 1fr); /* Better button layout */
    }
  
    .btn {
      padding: 0.5rem;
      font-size: 0.8rem;
    }
  }

  