/**
 * Photo Cropper Component Styles
 * Used by js/modules/photoCropper.js
 */

.photo-cropper-container {
    position: relative;
    width: 100%;
    user-select: none;
}

.cropper-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    background: #1a1a2e;
    border-radius: 8px;
    overflow: hidden;
}

.cropper-canvas {
    display: block;
    max-width: 100%;
    max-height: 350px;
}

/* Dark overlay outside crop area */
.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* Crop selection box */
.crop-box {
    position: absolute;
    border: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    box-sizing: border-box;
}

/* Rule of thirds grid */
.crop-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.grid-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
}

.grid-line.horizontal {
    left: 0;
    right: 0;
    height: 1px;
    top: 33.33%;
}

.grid-line.vertical {
    top: 0;
    bottom: 0;
    width: 1px;
    left: 33.33%;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid #4f46e5;
    border-radius: 2px;
    z-index: 10;
}

.resize-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.resize-handle:hover {
    background: #4f46e5;
    border-color: #fff;
}

/* Silhouette guide overlay */
.crop-silhouette {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5%;
}

.crop-silhouette svg {
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

/* Crop info label */
.crop-info {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(79, 70, 229, 0.9);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: 500;
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .resize-handle {
        width: 20px;
        height: 20px;
    }

    .resize-handle.nw {
        top: -10px;
        left: -10px;
    }

    .resize-handle.ne {
        top: -10px;
        right: -10px;
    }

    .resize-handle.sw {
        bottom: -10px;
        left: -10px;
    }

    .resize-handle.se {
        bottom: -10px;
        right: -10px;
    }
}

/* ============================================
   Zoom Controls
   ============================================ */

.zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 8px;
    margin-top: 0.75rem;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.zoom-btn:hover {
    background: #4f46e5;
    color: white;
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-slider-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 200px;
}

.zoom-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #d1d5db;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

.zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.zoom-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.zoom-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    min-width: 40px;
    text-align: center;
}

/* Dark theme support for zoom controls */
[data-theme="dark"] .zoom-controls {
    background: #1e1e2e;
}

[data-theme="dark"] .zoom-btn {
    background: #333;
    color: #f0f0f0;
}

[data-theme="dark"] .zoom-btn:hover {
    background: #6366f1;
}

[data-theme="dark"] .zoom-slider {
    background: #444;
}

[data-theme="dark"] .zoom-slider::-webkit-slider-thumb {
    background: #6366f1;
}

[data-theme="dark"] .zoom-slider::-moz-range-thumb {
    background: #6366f1;
}

[data-theme="dark"] .zoom-value {
    color: #e0e0e0;
}
