.cropper-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cropper-container {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 85%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.3s ease;
}

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

.cropper-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
}

.cropper-image-container {
    position: relative;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    background-color: #f0f0f0;
}

.cropper-original-image {
    display: block;
    object-fit: contain;
}

.cropper-selection {
    position: absolute;
    border: 2px dashed rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    cursor: move;
    touch-action: none;
}

.cropper-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: #fff;
    border: 1px solid #12584d;
    border-radius: 50%;
}

.cropper-handle.nw {
    top: -7px;
    left: -7px;
    cursor: nw-resize;
}

.cropper-handle.ne {
    top: -7px;
    right: -7px;
    cursor: ne-resize;
}

.cropper-handle.sw {
    bottom: -7px;
    left: -7px;
    cursor: sw-resize;
}

.cropper-handle.se {
    bottom: -7px;
    right: -7px;
    cursor: se-resize;
}

.cropper-handle.n {
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    cursor: n-resize;
}

.cropper-handle.s {
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    cursor: s-resize;
}

.cropper-handle.e {
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    cursor: e-resize;
}

.cropper-handle.w {
    left: -7px;
    top: 50%;
    transform: translateY(-50%);
    cursor: w-resize;
}

.cropper-instructions {
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0 20px;
    text-align: center;
    max-width: 80%;
}

.cropper-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 10px;
}

.cropper-controls button {
    min-width: 120px;
    padding: 12px 20px;
    margin: 0 10px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.cropper-controls button.cancel {
    background-color: #f0f0f0;
    color: #333;
}

.cropper-controls button.cancel:hover {
    background-color: #e0e0e0;
}

.cropper-controls button.crop {
    background-color: #12584d;
    color: white;
}

.cropper-controls button.crop:hover {
    background-color: #0d4239;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cropper-dialog {
        align-items: flex-start;
        padding-top: 10px;
    }
    
    .cropper-container {
        padding: 16px;
        width: 95%;
        max-height: 90%;
        overflow-y: auto;
        border-radius: 10px;
        margin: auto;
    }
    
    .cropper-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .cropper-instructions {
        font-size: 0.85rem;
        margin: 8px 0 15px;
    }
    
    .cropper-controls {
        flex-direction: row;
        padding: 0 5px;
    }
    
    .cropper-controls button {
        min-width: 100px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Hacer los controles de redimensionamiento más grandes para facilitar el uso táctil */
    .cropper-handle {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }
    
    .cropper-handle.nw {
        top: -16px;
        left: -16px;
    }
    
    .cropper-handle.ne {
        top: -16px;
        right: -16px;
    }
    
    .cropper-handle.sw {
        bottom: -16px;
        left: -16px;
    }
    
    .cropper-handle.se {
        bottom: -16px;
        right: -16px;
    }
    
    .cropper-handle.n {
        top: -16px;
    }
    
    .cropper-handle.s {
        bottom: -16px;
    }
    
    .cropper-handle.e {
        right: -16px;
    }
    
    .cropper-handle.w {
        left: -16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .cropper-container {
        background-color: #222;
    }
    
    .cropper-title {
        color: #f0f0f0;
    }
    
    .cropper-instructions {
        color: #ccc;
    }
    
    .cropper-image-container {
        background-color: #333;
    }
    
    .cropper-selection {
        border-color: rgba(255, 255, 255, 0.9);
    }
    
    .cropper-handle {
        background-color: #fff;
        border-color: #12584d;
    }
    
    .cropper-controls button.cancel {
        background-color: #333;
        color: #f0f0f0;
    }
    
    .cropper-controls button.cancel:hover {
        background-color: #444;
    }
}

/* Estilos para los botones de selección de imagen en móviles */
.mobile-image-buttons {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    padding: 10px 0 14px 0;
    gap: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
    box-sizing: border-box;
}

/* Utilizamos las clases de botones existentes en la aplicación */
.mobile-image-buttons .button {
    flex: 1;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-image-buttons .button.withIcon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-image-buttons .button.withIcon .icon {
    margin-right: 8px;
    font-size: 20px;
}

/* Mantemos os botóns en fila tamén en pantallas pequenas */
