/* Quick Image Fix - Image Cropper Styles */

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: #667eea;
  color: white;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 1rem;
  outline: 2px solid #764ba2;
  outline-offset: 2px;
}

/* Header & nav (matches Rotate Flip Image) */
.header {
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  color: #2d3748;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.08);
}
.nav-link-active {
  color: #667eea !important;
  font-weight: 600;
  background: rgba(102, 126, 234, 0.1);
}

.dropdown-menu { z-index: 60; }
.dropdown-item { white-space: nowrap; }

.mobile-menu[aria-hidden="false"] .mobile-drawer { transform: translateX(0); }
.mobile-menu[aria-hidden="false"] .mobile-overlay { opacity: 1; pointer-events: auto; }
.mobile-menu[aria-hidden="true"] { pointer-events: none; }
.mobile-menu[aria-hidden="false"] { pointer-events: auto; }
.mobile-menu .mobile-overlay { opacity: 0; pointer-events: none; transition: opacity 0.3s; }
@media (max-width: 767px) {
  .mobile-drawer { -webkit-overflow-scrolling: touch; }
  .mobile-nav-list a { min-height: 44px; display: flex; align-items: center; }
  .hamburger { min-width: 44px; min-height: 44px; display: inline-flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
  .hamburger .hamburger-icon { width: 24px; height: 2px; min-height: 2px; background-color: #2d3748; border-radius: 1px; margin: 0; display: block; }
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Cropper.js overrides for brand consistency */
.cropper-view-box,
.cropper-face {
    border-radius: 0;
}

.cropper-modal {
    background-color: rgba(0, 0, 0, 0.5);
}

.cropper-line,
.cropper-point {
    background-color: #667eea;
}

.cropper-point.point-se {
    width: 12px;
    height: 12px;
}

/* Circular crop overlay - visible circular selector on canvas */
#cropper-wrapper.circle-crop-mode .cropper-view-box {
    border-radius: 50%;
    overflow: hidden;
}

#cropper-wrapper.circle-crop-mode .cropper-face {
    border-radius: 50%;
    overflow: hidden;
}

/* Circular outline for crop box - user sees circle, handles still work */
#cropper-wrapper.circle-crop-mode .cropper-crop-box {
    border-radius: 50%;
}

#cropper-wrapper.circle-crop-mode .cropper-point {
    background-color: #667eea;
}

/* Grid overlay custom colors */
.cropper-dashed-h,
.cropper-dashed-v {
    border-color: rgba(102, 126, 234, 0.5);
}

/* Rule of thirds grid - 3 lines */
.cropper-grid.rule-of-thirds .cropper-grid-line {
    border-color: rgba(102, 126, 234, 0.6);
}

/* Active preset button state */
.aspect-preset.active,
.preset-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

/* Crop canvas container - ensure proper sizing */
#crop-interface .cropper-container {
    max-height: 400px;
    max-width: 100%;
}

/* Batch thumbnails with remove button */
.batch-thumb-item {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}
.batch-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
}
.batch-thumb-item.active img {
    border-color: #667eea;
}
.batch-thumb-item .remove-thumb-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.batch-thumb-item .remove-thumb-btn:hover {
    background: #dc2626;
}

/* Touch-friendly handles for mobile */
@media (max-width: 640px) {
    .cropper-point {
        width: 14px;
        height: 14px;
    }
}

/* Smooth transitions */
button, a {
    transition: all 0.2s ease;
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Results grid items */
#results-grid .result-item {
    transition: transform 0.2s ease;
}

#results-grid .result-item:hover {
    transform: scale(1.02);
}

/* Checkered background for transparent image preview (circular crops) */
#results-grid .result-item .bg-gray-100 {
    background-color: #e5e7eb;
    background-image: 
        linear-gradient(45deg, #d1d5db 25%, transparent 25%),
        linear-gradient(-45deg, #d1d5db 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d1d5db 75%),
        linear-gradient(-45deg, transparent 75%, #d1d5db 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
    background-repeat: repeat;
}

/* Upload area hover state */
#upload-area.drag-over {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

/* Quality slider styling */
#output-quality {
    accent-color: #667eea;
}

