/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #000000;
  color: #ffffff;
  height: 100vh;
  overflow: hidden;
}

/* Top Navigation Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2.7rem;
  background: #000000;
  border-bottom: 1px solid #333;
  height: 5vh;
  min-height: 50px;
  max-height: 70px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffffff;
}

.auth-buttons {
  display: flex;
  gap: 1rem;
}

.auth-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
}

.login-btn {
  background: #1976d2;
  color: #ffffff;
  border: 1px solid #333;
}

.login-btn:hover {
  background: #1565c0;
}



/* Main Container */
.main-container {
  display: grid;
  grid-template-columns: minmax(90px, 8%) 1fr minmax(90px, 8%);
  grid-template-rows: 1fr;
  height: calc(100vh - 12vh - 5vh);
  margin-top: 5vh;
  position: relative;
  align-items: center;
}

/* Left Sidebar */
.left-sidebar {
  width: 8%;
  min-width: 90px;
  max-width: 120px;
  background: #000000;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-right: 1px solid #333;
  grid-column: 1;
  grid-row: 1;
  z-index: 2;
}

.sidebar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  aspect-ratio: 1;
}

/* Central Image Preview Area */
.image-preview-area {
  width: 90%;
  max-width: 700px;
  height: 90%;
  max-height: 700px;
  display: none;
  justify-content: center;
  align-items: center;
  background: #000000;
  padding: 2rem;
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
  overflow: hidden; /* Prevent overflow */
  margin: 0 auto; /* Center the area */
  border-radius: 8px;
  align-self: center; /* Ensure vertical centering within grid */
}

.image-preview-area.active {
  display: flex;
}

.image-container {
  position: relative;
  width: 100%;
  height: 100%;
  border: 2px solid #666;
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem; /* Add padding around the image */
}

/* Processing animation overlay */
.image-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.1) 75%,
    transparent 100%
  );
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

/* Processing animation state */
.image-container.processing::before {
  opacity: 1;
  animation: processingGlow 2s ease-in-out infinite;
}

/* Blurred glow wiping animation */
@keyframes processingGlow {
  0% {
    transform: translateX(-100%);
    filter: blur(0px);
  }
  25% {
    filter: blur(2px);
  }
  50% {
    transform: translateX(0%);
    filter: blur(4px);
  }
  75% {
    filter: blur(2px);
  }
  100% {
    transform: translateX(100%);
    filter: blur(0px);
  }
}

/* Additional glow effect during processing */
.image-container.processing {
  box-shadow: 
    0 0 20px rgba(255, 255, 255, 0.3),
    0 0 40px rgba(255, 255, 255, 0.2),
    0 0 60px rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.3s ease;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto;
}

/* Hide preview image when main container is hidden */
.main-container[style*="display: none"] .preview-image {
  display: none !important;
}

.edit-canvas {
  max-width: 100%;
  max-height: 100%;
  background: #2a2a2a;
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: crosshair;
  pointer-events: auto;
}

.brush-indicator {
  position: absolute;
  border: 2px solid #d5d5d5;
  border-radius: 50%;
  pointer-events: none;
  display: none;
  z-index: 1000;
}

/* Right Sidebar */
.right-sidebar {
  width: 8%;
  min-width: 90px;
  max-width: 120px;
  background: #000000;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-left: 1px solid #333;
  grid-column: 3;
  grid-row: 1;
  z-index: 2;
}

/* Button overlay removed - edit tools are now always accessible */

.right-sidebar-edit-tools {
  width: 15%;
  min-width: 180px;
  max-width: 250px;
  padding: 1rem;
  display: none;
  flex-direction: column;
  gap: 1rem;
  position: absolute;
  right: 8%;
  top: 5vh;
  bottom: 10vh;
  z-index: 100;
  border-radius: 8px;
}

.right-sidebar-edit-tools.active {
  display: flex;
}

/* Left Sidebar Edit Tools */
.left-sidebar-edit-tools {
  width: 15%;
  min-width: 180px;
  max-width: 250px;
  padding: 1rem;
  display: none;
  flex-direction: column;
  gap: 1rem;
  position: absolute;
  left: 8%;
  top: 5vh;
  bottom: 10vh;
  z-index: 100;
  border-radius: 8px;
}

.left-sidebar-edit-tools.active {
  display: flex;
}

/* Reset button styling */
.reset-btn {
  background: #ff4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
  width: 100%;
}

.reset-btn:hover {
  background: #ff6666;
}

.img-adjust-btn, .redo-btn, .undo-btn, .bin-btn, .brush-btn, .download-btn, .eraser-btn, .add-bg-btn {
  background: transparent;
  color: transparent;
}

.img-adjust-btn:hover, .redo-btn:hover, .undo-btn:hover, .bin-btn:hover, .brush-btn:hover, .download-btn:hover, .eraser-btn:hover, .add-bg-btn:hover {
  background: #303030;
}

.download-btn .icon-download {
  width: 100%;
  max-width: 77px;
  height: auto;
  aspect-ratio: 1;
  fill: #4caf50;
  stroke: #4caf50;
}

.eraser-btn .icon-eraser {
  width: 100%;
  max-width: 77px;
  height: auto;
  aspect-ratio: 1;
  fill: #949494;
  stroke: #949494;
}

.add-bg-btn .icon-addbg {
  width: 100%;
  max-width: 77px;
  height: auto;
  aspect-ratio: 1;
  fill: #949494;
  stroke: #949494;
}

.bin-btn .icon-bin {
  width: 100%;
  max-width: 77px;
  height: auto;
  aspect-ratio: 1;
  fill: #ff5454;
  stroke: #ff5454;
}

.undo-btn .icon-undo {
  width: 100%;
  max-width: 77px;
  height: auto;
  aspect-ratio: 1;
  fill: #949494;
  stroke: #949494;
}

.img-adjust-btn .icon-adjust {
  width: 100%;
  max-width: 77px;
  height: auto;
  aspect-ratio: 1;
  fill: #949494;
  stroke: #949494;
}

.redo-btn .icon-redo {
  width: 100%;
  max-width: 77px;
  height: auto;
  aspect-ratio: 1;
  fill: #949494;
  stroke: #949494;
}

.brush-btn .icon-brush {
  width: 100%;
  max-width: 77px;
  height: auto;
  aspect-ratio: 1;
  fill: #949494;
  stroke: #949494;
}
/* Bottom Toolbar */
.bottom-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8vh;
  min-height: 60px;
  max-height: 90px;
  background: #000000;
  border-top: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2.7rem;
  box-sizing: border-box;
  z-index: 1000;
}

.mode-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0;
  height: 100%;
  box-sizing: border-box;
}

.mode-btn {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 6px;
  background: #1976d2;
  color: #ffffff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-btn:hover {
  background: #1565c0;
}

.mode-btn.active {
  background: #0d47a1;
}

/* Upload Section */
.upload-section {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}

.upload-section.active {
  display: flex;
}

.upload-center {
  text-align: center;
  color: #ffffff;
  max-width: 600px;
  width: 90%;
}

.upload-area {
  background: #2a2a2a;
  border: 2px dashed #666;
  border-radius: 12px;
  padding: 3rem 2rem;
  margin: 2rem 0;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 40vh;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.upload-area:hover {
  border-color: #4caf50;
  background: #333;
}

.upload-area.dragover {
  border-color: #4caf50;
  background: #1a1a1a;
}

.upload-instructions {
  color: #ffffff;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-weight: bold;
}

.upload-link {
  color: #4caf50;
  cursor: pointer;
  font-weight: bold;
}

.upload-link:hover {
  color: #66bb6a;
}

.upload-preview {
  max-width: 100%;
  max-height: 300px;
  margin-top: 1rem;
  border: 1px solid #666;
  border-radius: 4px;
  display: none;
}

/* Edit Tools Panel */
.edit-tools-panel.active {
  display: block;
}

.edit-tools-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #333;
}

.edit-tools-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: bold;
}

.close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.close-btn:hover {
  background: #333;
}

.control-group {
  margin-bottom: 1rem;
}

.control-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: bold;
}

.control-group input[type="range"] {
  width: 100%;
  margin: 0.5rem 0;
}

.control-group input[type="color"] {
  margin-left: 0.5rem;
  vertical-align: middle;
}

.radio-group {
  display: inline-flex;
  gap: 1rem;
  margin-top: 0.5rem;
  align-items: center;
  text-align: center;
}

.radio-group input[type="radio"] {
  margin-right: 0.25rem;
}

.radio-group label {
  display: inline;
  margin-bottom: 0;
}

/* Control Panels */
.control-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
  display: none;
  z-index: 1000;
}

.control-panel.active {
  display: block;
}

.control-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #333;
}

.control-panel-header label {
  margin: 0;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: bold;
}

/* Processing Elements */
.spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem 2rem;
  color: #ffffff;
  display: none;
  z-index: 1000;
}

.result-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.process-message {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  color: #ffffff;
  display: none;
  z-index: 1000;
}

/* File Input Styling */
input[type="file"] {
  background: #333;
  border: 1px solid #666;
  border-radius: 4px;
  color: #ffffff;
  padding: 0.5rem;
  margin: 0.5rem 0;
}

input[type="file"]::-webkit-file-upload-button {
  background: #1976d2;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  margin-right: 1rem;
}

input[type="file"]::-webkit-file-upload-button:hover {
  background: #1565c0;
}

/* Background Controls */
.background-controls {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
}

#bgColorInput {
  display: none;
}

/* Confirmation Dialogs */
.confirmation-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.confirmation-dialog.active {
  display: flex;
}

.dialog-content {
  background: rgba(26, 26, 26, 0.8);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  max-width: 90%;
  width: clamp(300px, 50vw, 500px);
  color: #ffffff;
  align-items: center;
  text-align: center;
}

.dialog-content h3 {
  margin: 0 0 0.5rem 0;
  color: #ffffff;
  font-size: 1.0rem;
  font-weight: bold;
  align-items: center;
  text-align: center;
}

.dialog-content h5 {
  margin: 0 0 0.5rem 0;
  color: #ffffff;
  font-size: 1.0rem;
  font-weight: bold;
  align-items: center;
  text-align: center;
}

.dialog-content p {
  margin: 0 0 0.75rem 0;
  color: #cccccc;
  line-height: 1.2;
  font-size: 0.85rem;
  align-items: center;
}

.dialog-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.dialog-btn {
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
}

.cancel-btn {
  background: #666;
  color: #ffffff;
}

.cancel-btn:hover {
  background: #555;
}

.apply-btn {
  background: #1976d2;
  color: #ffffff;
}

.apply-btn:hover {
  background: #1565c0;
}

/* Control Groups */
.sensitivity-control {
  margin: 0.5rem 0;
}

.sensitivity-control label {
  display: block;
  margin-bottom: 0.25rem;
  color: #ffffff;
  font-size: 0.8rem;
}

.sensitivity-control input[type="range"] {
  width: 100%;
  margin: 0.25rem 0;
}

.mask-input-control {
  margin: 0.5rem 0;
}

.mask-input-control label {
  margin: 1rem 0;
  font-size: 0.8rem;
}

.eyedropper-controls {
  margin: 0.5rem 0;
}

.color-picker-control {
  margin-bottom: 0.5rem;
}

.color-picker-control label {
  display: block;
  margin-bottom: 0.25rem;
  color: #ffffff;
  font-size: 0.8rem;
}

.color-picker-control input[type="color"] {
  margin-left: 0.25rem;
  vertical-align: middle;
}

.color-swatch-container {
  margin-top: 1rem;
}

.color-swatch {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 2px solid #666;
  border-radius: 4px;
  vertical-align: middle;
}

/* Background Dialog Controls */
.background-type-control {
  margin: 0.5rem 0;
  align-items: center;
  text-align: center;
}

.background-type-control label {
  display: block;
  margin-bottom: 0.25rem;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: bold;
}

.background-input-control {
  margin: 0.5rem 0;
  display: inline-block;
}

.background-input-control label {
  display: block;
  margin-bottom: 0.25rem;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: bold;
}

.background-input-control input[type="file"] {
  width: 100%;
  margin: 0.25rem 0;
}

.background-input-control input[type="color"] {
  margin-left: 0.25rem;
  vertical-align: middle;
}

/* Responsive Design */
@media (max-width: 768px) {
  .left-sidebar, .right-sidebar {
    width: 10%;
    min-width: 70px;
    max-width: 77px;
  }
  
  .main-container {
    grid-template-columns: minmax(70px, 10%) 1fr minmax(70px, 10%);
  }
  
  .sidebar-btn {
    min-height: 60px;
    padding: 0.5rem;
  }
  
  .btn-text {
    font-size: 0.7rem;
    font-weight: bold;
  }
  
  .bottom-toolbar {
    height: 14vh;
    min-height: 110px;
    padding: 1rem 0.5rem;
    box-sizing: border-box;
  }
  
  .mode-buttons {
    gap: 0.5rem;
    padding: 0;
    height: 100%;
    box-sizing: border-box;
  }
  
  .mode-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: bold;
    min-height: 40px;
  }
  
  .download-btn .icon-download,
  .eraser-btn .icon-eraser,
  .add-bg-btn .icon-addbg,
  .bin-btn .icon-bin,
  .undo-btn .icon-undo,
  .img-adjust-btn .icon-adjust,
  .redo-btn .icon-redo,
  .brush-btn .icon-brush {
    width: 100%;
    max-width: 68px;
  }
  
  .upload-instructions {
    font-size: 0.77rem; /* 30% smaller than 1.1rem */
  }
} 

/* Auth Modal Styles */
.auth-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

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

.auth-modal-content {
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 0;
  width: clamp(280px, 90%, 450px);
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: modalSlideIn 0.3s ease-out;
  overflow: hidden;
}

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

.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 30px 0 30px;
  margin-bottom: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.auth-modal-header h2 {
  color: #fff;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.auth-modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  font-weight: 300;
}

.auth-modal-close:hover {
  background-color: #333;
  color: #fff;
  transform: scale(1.1);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 30px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  color: #ccc;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.form-group input {
  padding: 14px 16px;
  border: 2px solid #333;
  border-radius: 8px;
  background-color: #2a2a2a;
  color: #fff;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  background-color: #2f2f2f;
}

.form-group input::placeholder {
  color: #666;
}

.form-group button {
  padding: 14px 20px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.form-group button:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.form-group button:disabled {
  background: linear-gradient(135deg, #555 0%, #444 100%);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #333;
}

.auth-switch span {
  color: #888;
  font-size: 0.875rem;
}

.auth-switch button {
  background: none;
  border: none;
  color: #007bff;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-weight: 500;
}

.auth-switch button:hover {
  color: #0056b3;
  text-decoration: none;
}

.auth-error {
  margin: 0 30px 20px 30px;
  padding: 12px 16px;
  background-color: #dc3545;
  color: #fff;
  border-radius: 8px;
  font-size: 0.875rem;
  text-align: center;
  border: 1px solid #c82333;
}

/* User Avatar and Dropdown Styles */
.user-avatar-container {
  position: relative;
  display: inline-block;
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 30px;
  min-height: 30px;
  border-radius: 50%;
  background: #007bff;
  color: white;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  min-width: clamp(200px, 20vw, 280px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #333;
}

.dropdown-avatar {
  width: 2rem;
  height: 2rem;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: #007bff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.dropdown-user-info {
  flex: 1;
  min-width: 0;
}

.dropdown-email {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-role {
  color: #888;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-divider {
  height: 1px;
  background-color: #333;
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: #ccc;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: left;
}

.dropdown-item:hover {
  background-color: #333;
  color: #fff;
}

.dropdown-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Feedback button styling */
.dropdown-item.feedback-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: #fff;
  font-weight: 500;
  margin: 8px;
  border-radius: 6px;
  width: calc(100% - 16px);
  transition: all 0.2s ease;
}

.dropdown-item.feedback-btn:hover {
  background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Remove old user info styles */
.user-info {
  display: none;
}

.user-info .user-details {
  display: none;
}

.user-info .user-email {
  display: none;
}

.user-info .user-role {
  display: none;
}

.user-info .logout-btn {
  display: none;
} 

/* Responsive behavior for smaller screens */
@media (max-width: 900px) {
  .image-preview-area {
    width: 90%;
    max-width: 600px;
    height: 85%;
    max-height: 600px;
    padding: 1rem;
    align-self: center;
  }
}

@media (max-width: 800px) {
  .image-preview-area {
    width: 90%;
    max-width: 500px;
    height: 80%;
    max-height: 500px;
    padding: 0.75rem;
    align-self: center;
  }
}

@media (max-width: 700px) {
  .image-preview-area {
    width: 95%;
    max-width: 450px;
    height: 75%;
    max-height: 450px;
    padding: 0.5rem;
    align-self: center;
  }
}

@media (max-width: 600px) {
  .image-preview-area {
    width: 95%;
    max-width: 400px;
    height: 70%;
    max-height: 400px;
    padding: 0.5rem;
    align-self: center;
  }
  
  .left-sidebar-edit-tools,
  .right-sidebar-edit-tools {
    width: 20%;
    min-width: 160px;
  }
  
  .image-container {
    padding: 0.5rem;
  }
  
  .mode-buttons {
    gap: 0.4rem;
    padding: 0;
    height: 100%;
    box-sizing: border-box;
  }
  
  .mode-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-weight: bold;
    min-height: 36px;
  }
}

@media (max-width: 500px) {
  .image-preview-area {
    width: 98%;
    max-width: 350px;
    height: 65%;
    max-height: 350px;
    padding: 0.25rem;
    align-self: center;
  }
  
  .top-bar {
    padding: 1rem 1rem;
  }
  
  .image-container {
    padding: 0.25rem;
  }
  
  .mode-buttons {
    gap: 0.3rem;
    padding: 0;
    height: 100%;
    box-sizing: border-box;
  }
  
  .mode-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
    font-weight: bold;
    min-height: 32px;
  }
}

@media (max-width: 400px) {
  .image-preview-area {
    width: 100%;
    max-width: 320px;
    height: 60%;
    max-height: 320px;
    padding: 0.25rem;
    align-self: center;
  }
  
  .main-container {
    grid-template-columns: minmax(60px, 8%) 1fr minmax(60px, 8%);
  }
  
  .left-sidebar, .right-sidebar {
    width: 8%;
    min-width: 60px;
    max-width: 80px;
  }
  
  .image-container {
    padding: 0.25rem;
    min-height: 200px;
  }
  
  .preview-image,
  .result-image {
    max-width: calc(100% - 0.5rem);
    max-height: calc(100% - 0.5rem);
  }
  
  .mode-buttons {
    gap: 0.25rem;
    padding: 0;
    height: 100%;
    box-sizing: border-box;
  }
  
  .mode-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.6rem;
    font-weight: bold;
    min-height: 30px;
  }
}

/* Extra small mobile devices */
@media (max-width: 360px) {
  .image-preview-area {
    width: 100%;
    max-width: 300px;
    height: 55%;
    max-height: 300px;
    padding: 0.125rem;
    align-self: center;
  }
  
  .image-container {
    padding: 0.125rem;
    min-height: 180px;
  }
  
  .preview-image,
  .result-image {
    max-width: calc(100% - 0.25rem);
    max-height: calc(100% - 0.25rem);
  }
  
  .main-container {
    grid-template-columns: minmax(50px, 6%) 1fr minmax(50px, 6%);
  }
  
  .left-sidebar, .right-sidebar {
    width: 6%;
    min-width: 50px;
    max-width: 70px;
  }
  
  .mode-buttons {
    gap: 0.2rem;
    padding: 0;
    height: 100%;
    box-sizing: border-box;
  }
  
  .mode-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.55rem;
    font-weight: bold;
    min-height: 28px;
  }
} 