/* Avatar Cropper Styles */

#crop-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.crop-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 0;
}

.crop-modal {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    animation: cropSlideUp 0.25s ease-out;
}

@keyframes cropSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.crop-header {
    text-align: center;
    margin-bottom: 20px;
}

.crop-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2a2520;
    margin: 0 0 6px;
}

.crop-hint {
    font-size: 12px;
    color: #9e9892;
    margin: 0;
}

/* Canvas centrado sin elementos superpuestos */
.crop-canvas-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#crop-preview {
    display: block;
    border-radius: 50%;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

#crop-preview:active {
    cursor: grabbing;
}

/* Zoom */
.crop-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: #f9f6f2;
    border-radius: 10px;
}

.crop-zoom-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b6560;
    flex-shrink: 0;
}

.crop-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd8d1;
    border-radius: 2px;
    outline: none;
}

.crop-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c2beb5;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    transition: transform 0.15s;
}

.crop-slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.crop-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c2beb5;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.crop-zoom-value {
    font-size: 12px;
    font-weight: 600;
    color: #6b6560;
    min-width: 38px;
    text-align: right;
}

.crop-buttons {
    display: flex;
    gap: 12px;
}

.crop-buttons .btn {
    flex: 1;
}

@media (max-width: 520px) {
    .crop-modal {
        padding: 20px 16px;
        max-width: 98vw;
    }
}


.crop-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.crop-modal {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.crop-header {
    text-align: center;
    margin-bottom: 24px;
}

.crop-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2a2520;
    margin-bottom: 8px;
}

.crop-hint {
    font-size: 13px;
    color: #9e9892;
    margin: 0;
}

.crop-canvas-container {
    position: relative;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

#crop-preview {
    border: 2px solid #c2beb5;
    border-radius: 12px;
    cursor: grab;
    display: block;
    background: #f0f0f0;
    user-select: none;
}

#crop-preview:active {
    cursor: grabbing;
}

.crop-overlay {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 2px dashed #c2beb5;
    border-radius: 12px;
    pointer-events: none;
    top: 0;
    left: 0;
}

.crop-crosshair {
    position: absolute;
    width: 300px;
    height: 300px;
    pointer-events: none;
    top: 0;
    left: 0;
}

.crop-crosshair::before,
.crop-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(194, 190, 181, 0.4);
}

.crop-crosshair::before {
    width: 1px;
    height: 100%;
    left: 50%;
    top: 0;
}

.crop-crosshair::after {
    height: 1px;
    width: 100%;
    top: 50%;
    left: 0;
}

.crop-controls {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9f6f2;
    border-radius: 10px;
}

.crop-control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crop-control-group label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b6560;
    letter-spacing: 0.5px;
}

.crop-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crop-slider {
    flex: 1;
    height: 4px;
    appearance: none;
    background: linear-gradient(to right, #c2beb5 0%, #c2beb5 100%);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.crop-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c2beb5;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(194, 190, 181, 0.4);
    transition: all 0.2s;
}

.crop-slider::-webkit-slider-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(194, 190, 181, 0.6);
}

.crop-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c2beb5;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(194, 190, 181, 0.4);
    transition: all 0.2s;
}

.crop-slider::-moz-range-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(194, 190, 181, 0.6);
}

.crop-value {
    font-size: 12px;
    font-weight: 600;
    color: #6b6560;
    min-width: 40px;
    text-align: right;
}

.crop-buttons {
    display: flex;
    gap: 12px;
}

.crop-buttons .btn {
    flex: 1;
}

@media (max-width: 600px) {
    .crop-modal {
        padding: 20px;
    }

    #crop-preview,
    .crop-overlay,
    .crop-crosshair {
        width: 250px !important;
        height: 250px !important;
    }

    .crop-modal {
        max-width: 90vw;
    }
}

/* ── Blog Cover Cropper (16:9) ─────────────────────────────── */
.blog-crop-modal {
    max-width: 560px;
}

#blog-crop-preview {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
    border: 2px solid #c2beb5;
}

#blog-crop-preview:active {
    cursor: grabbing;
}

@media (max-width: 600px) {
    .blog-crop-modal {
        padding: 16px;
    }
}
